#D12508. Vector
Vector
Vector
For a dynamic array of integers, perform a sequence of the following operations:
- pushBack(): add element at the end of
- randomAccess():print element
- popBack(): delete the last element of
is a 0-origin array and it is empty in the initial state.
Constraints
- the size of
Input
The input is given in the following format.
:
Each query is given by
0
or
1
or
2
where the first digits 0, 1 and 2 represent pushBack, randomAccess and popBack operations respectively.
randomAccess and popBack operations will not be given for an empty array.
Output
For each randomAccess, print in a line.
Example
Input
8 0 1 0 2 0 3 2 0 4 1 0 1 1 1 2
Output
1 2 4
inputFormat
Input
The input is given in the following format.
:
Each query is given by
0
or
1
or
2
where the first digits 0, 1 and 2 represent pushBack, randomAccess and popBack operations respectively.
randomAccess and popBack operations will not be given for an empty array.
outputFormat
Output
For each randomAccess, print in a line.
Example
Input
8 0 1 0 2 0 3 2 0 4 1 0 1 1 1 2
Output
1 2 4
样例
8
0 1
0 2
0 3
2
0 4
1 0
1 1
1 2
1
2
4
</p>