N,M=map(int,input().split()) X=list(map(int,input().split())) Y=list(map(int,input().split())) inf=float("inf") for x in X: z=inf for y in Y: if x