n,S,B=map(int,input().split()) h=list(map(int,input().split())) q=[] for v in h: while len(q)>0 and q[-1]