Here is my solution that works for O(1) in average case. There are two queues: in and out. See pseudocode bellow:
PUSH(X) = in.enqueue(X)
POP: X =
if (out.isEmpty and !in.isEmpty)
DUMP(in, out)
return out.dequeue
DUMP(A, B) =
if (!A.isEmpty)
x = A.dequeue()
DUMP(A, B)
B.enqueue(x)