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

`push_back(value)`- the value is added to the end array.`pop_back()`- the last element from the list is removed. Note that, if the array is empty, you should ignore this operation.`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

**lines contain the operations. Each operation is described by its type (**

`M``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 ≤ 10`^{3}`1 ≤ value for each operation of type 1 and 3 ≤ 10`^{5}

### Sample

Input | Output | Explanation |
---|---|---|

61 1 1 2 1 3 2 3 0 3 2 | Empty1 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]. |

### Sergiu Pușcaș - Python 3

1 #!/usr/bin/python3 2 3 v = [] 4 for t in range(int(input())): 5 line = input().split() 6 7 if line[0] == '1': 8 v.append(line[1]) 9 if line[0] == '2' and len(v) > 0: 10 v.pop() 11 if line[0] == '3': 12 filtered = [x for x in v if int(x) <= int(line[1])] 13 print("Empty" if filtered == [] else ' '.join(filtered))

### Cosmin Rusu - C++11

1 #include <iostream> 2 #include <vector> 3 4 using namespace std; 5 6 int main() { 7 vector <int> v; 8 int n; 9 10 cin >> n; 11 while(n--) { 12 int op, x; 13 cin >> op; 14 if(op == 1) { 15 cin >> x; 16 v.push_back(x); 17 } 18 else if(op == 2) { 19 if(v.size()) 20 v.pop_back(); 21 } 22 else { 23 cin >> x; 24 vector <int> aux; 25 for(auto it : v) 26 if(it <= x) 27 aux.push_back(it); 28 if(aux.size() == 0) { 29 cout << "Empty"; 30 } 31 else 32 for(auto it : aux) 33 cout << it << ' '; 34 cout << '\n'; 35 } 36 } 37 38 return 0; 39 }