Show a Python implementation of a queue using two stacks and explain its amortized cost.