The first line of input contains three integers N, M and Q(2 ≤ N, M, Q ≤ 105), the number of students, the number of places,
and the number of commands by Hammouri, respectively.
Students are numbered from 1 to N. Places are numbered from 1 to M.
The second line contains N integers, where the ith integer represents the location covered by the ith student initially.
Each of the following Q lines represents a command and contains two integers, A and B, where A(1 ≤ A ≤ N) is the number of a
student and B(1 ≤ B ≤ M) is the number of a place. The command means student number A should go and cover place number B.
It is guaranteed that B is different from the place currently covered by student A.
Changes are given in chronological order.