Design a cache with O(1) get and put operations.
Implement an LRU cache with a fixed positive capacity. get(key) returns the value or -1 when absent. put(key, value) inserts or updates an entry, evicting the least recently used entry when full. Both operations must run in O(1) average time.
Use lru_cache(capacity, operations), where each operation is ['get', key] or ['put', key, value]. Return the values produced by get operations in order.
def lru_cache(capacity, operations):