QUEUEEZ - Easy Queue

You have an empty queue and your boss has some queries. These queries are queue's basic operations such as Enqueue, Dequeue, and printing some values. Now, your boss asks you to process his queries.

Input

First line contains an integer T (0 <= T <= 106).

Each of the T next lines contains a query based on these formats.

1 n : Enqueue n (-109 <= n <= 109) to the queue.

2 : Dequeue an element from the queue. If the queue is empty, do nothing.

3 : Print the queue's first element's value (see Output).

Output

For each query 3, print the queue's first element's value. If the queue is empty, print 'Empty!' without quotes.

Example

Input:
6
1 5
1 6
2
3
2
3

Output:
6
Empty!

Warning!

Enormous input data!


Added by:Lucas
Date:2017-02-15
Time limit:0.5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2022-09-22 05:09:36
I passed in c++, but always TLE in Python.
2022-09-01 15:36:23
If you use c++ , use Fast input/output
ios_base::sync_with_stdio(false);
cin.tie(NULL);
and do not use endl use "\n"
to avoid TLE

Last edit: 2022-09-01 15:38:03
2021-08-12 21:58:01
IF u use c++ write this two lines in the main fun to avoid TLE
cin.tie(0);
cin.sync_with_stdio(0);
2021-04-10 11:23:58
You given TLE? Don't use any struct!
2020-04-06 04:04:32
i have faced TLE in many problems. but my code was absolutely correct. so problem was cin and cout instead scanf and printf in c++. so if u are using this , please get rid of , otherwise i m very much sure you will get TLE.
2020-03-11 05:30:40
why is it giving me ac?
2018-08-16 12:09:41
It is showing TLE there is some problem in test cases
2018-08-04 10:36:08
why is it giving TLE?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.