#Lutece1304. Infinity Set
Infinity Set
Migrated from Lutece 1304 Infinity Set
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Little A
likes infinite set very much, so he creates a infinite set.
First, two numbers (may same) was added into an empty set. Next, if numbers and are in this set, was added into this set.
Because of this set has infinite numbers, Little A
wants to know he small number in this set.
Input
The first line contains two numbers , indicating the numbers added into empty set.
The second line contains one number , indicating the numbers of queries.
Next lines each line contains one number , indicating the query.
Output
For each query output one line.
Each line contains one number, the small number in the set.
Samples
2 3
5
1
2
3
4
5
2
3
4
5
6
3 5
5
1
2
3
4
5
3
5
6
8
9
Resources
The 14th UESTC Programming Contest Preliminary