```python
import heapq

def heap_replace(heap, a):
    """
    Deletes the smallest element from the given heap and then inserts a new item.
    """
    heapq.heapreplace(heap, a)
```