package yukicoder; import java.util.Scanner; public class N488 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int N=sc.nextInt(); int M=sc.nextInt(); int abuf=0; int bbuf=0; int cnt=0; int end=0; long[] a=new long[N],b=new long[M]; for(int i=0;ibbuf)?abuf:bbuf); } for(int i=0;i