AT_abc424_b [ABC424B] Perfect
Description
$ N $ people participated in a programming contest consisting of $ M $ problems.
The participants are numbered person $ 1 $ , person $ 2 $ , $ \ldots $ , person $ N $ , and the problems are numbered problem $ 1 $ , problem $ 2 $ , $ \ldots $ , problem $ M $ .
In this contest, $ K $ events occurred in order; in the $ i $ -th event $ (1\leq i\leq K) $ , the following happened:
- Person $ A_i $ solved problem $ B_i $ .
The same event does not occur two or more times. Also, apart from these $ K $ events, nobody solves any problem.
Output the numbers of all people who solved all problems.
If there are multiple such people, output them in ascending order of the time at which they solved all problems.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ M $ $ K $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $ \vdots $ $ A_K $ $ B_K $
Output Format
Output, on one line and separated by spaces, the numbers of all people who solved all problems, in ascending order of the time at which they solved all problems. If there is no person who solved all problems, output nothing.
Explanation/Hint
### Sample Explanation 1
In the contest, the following happened in order.
- Person $ 1 $ solved problem $ 1 $ . So far, person $ 1 $ has solved only problem $ 1 $ .
- Person $ 3 $ solved problem $ 2 $ . So far, person $ 3 $ has solved only problem $ 2 $ .
- Person $ 2 $ solved problem $ 1 $ . So far, person $ 2 $ has solved only problem $ 1 $ .
- Person $ 3 $ solved problem $ 1 $ . So far, person $ 3 $ has solved problems $ 1,2 $ . Thus, at this point person $ 3 $ has solved all problems.
- Person $ 1 $ solved problem $ 2 $ . So far, person $ 1 $ has solved problems $ 1,2 $ . Thus, at this point person $ 1 $ has solved all problems.
Thus, the people who solved all problems are persons $ 1,3 $ , and the one who solved all problems earlier is person $ 3 $ . Thus, output $ 3,1 $ in this order, separated by spaces.
### Sample Explanation 2
If there is no person who solved all problems, output nothing.
### Constraints
- $ 1 \leq N \leq 10 $
- $ 1 \leq M \leq 10 $
- $ K \geq 1 $
- $ 1 \leq A_i \leq N $
- $ 1 \leq B_i \leq M $
- If $ i\neq j $ then $ (A_i,B_i)\neq (A_j,B_j) $ .
- All input values are integers.