Help needed in this question

There are N servers represented by their server IDs which are from 1 to N. The
servers must serve M requests from users at the given request time. The request
served in round-robin fashion starting from the first server. Due to hardware
failure, X servers go down. The time of failure of these X servers are also given as
input. The program must find the server which served the last request and
print its server ID. If all the servers have failed before serving the last request, the
program must print -1 as the output.
Boundary Condition(s):
1<=N<=99
1<=M<=1000
0<=X<=N
1 <= Time of Request <= 10^9
1 <= Server Downtime <= 10^9
Input Format:
The first line contains the value of N and M separated by space(S)
The next M lines contain the request time of the requests
The (M + 2)th line contains the value of X
The next X lines contain server ID with the server downtime

Output Format:
The first line contains the server ID which served last or -1.

Input-1
5 10
2
5
15
18
21
32
43
56
180
200
5
3 20
4 30
2 50
5 100
1 180

Output -1
-1

Input-2:
4 6
11
22
33
44
55
66
2
3 33
2 55

Ouput-2
1