Virtual Pharmacy

You have an array, initially empty. You are supposed to apply the following operations on it:

  1. push_back(value) - the value is added to the end array.
  2. pop_back() - the last element from the list is removed. Note that, if the array is empty, you should ignore this operation.
  3. filter(value) - print all the elements in the array that are less than or equal to value, in the same order they are stored in the array. If there are no such elements, print Empty.

Note: you will receive full feedback for this problem.

Input

The first line contains M, the number of operations you need to perform.
The following M lines contain the operations. Each operation is described by its type (1, 2, or 3). Operations of type 1 and 3 are followed by value.

Output

For each operation of type 3, print a space-separated list containing the filter result.

Constraints

  • 1 ≤ M ≤ 103
  • 1 ≤ value for each operation of type 1 and 3 ≤ 105

Sample

InputOutputExplanation
6
1 1
1 2
1 3
2
3 0
3 2
Empty
1 2
Initially: []
1st operation: [1]
2nd operation: [1, 2]
3rd operation: [1, 2, 3]
4th operation: [1, 2]
5th operation: there are no elements less than or equal to 0, so the message Empty is printed.
6th operation: all the elements are less than or equal to 3, so the result is the list [1, 2].
Questions?

Sponsors Gold