import java.util.Scanner; publicclassMain { publicstaticvoidmain(String[] args) { Scannersc=newScanner(System.in); intn= sc.nextInt(); int[] a = newint[n]; intm= sc.nextInt(); int[] b = newint[m]; intd=1000; for (inti=0; i < n; i++) a[i] = sc.nextInt(); for (intj=0; j < m; j++) b[j] = sc.nextInt(); for (int k : a) for (int i : b) { ints= k - i; d = Math.min(d, Math.abs(s)); } System.out.println(d); } }