from random import * K,N=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) for i in range(54321): M=min(A[i],B[0]) for j in range(K): X=A[i+j] if X>B[j]: X=B[j] if M