n,m,k=map(int,input().split()) a=list(map(int,input().split())) def f(v,c,i): if m