n=int(input()) D=list(map(int,input().split())) x,y=map(int,input().split()) MAX=max(D) x=abs(x) y=abs(y) if x==y==0: print(0) exit() if max(x,y)