import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] X = new int[N]; int[] Y = new int[M]; for( int i = 0; i < N; i++ ) { X[i] = sc.nextInt(); } for( int i = 0; i < M; i++ ) { Y[i] = sc.nextInt(); } Arrays.sort(Y); for( int i = 0; i < N; i++ ) { int index = lowerBound(Y,X[i]); System.out.println( X[i] > Y[index] ? "Infinity" : Y[index]-X[i] ); } } static int lowerBound ( int[] arr, int value ) { int high = arr.length-1; int low = 0; while( low < high ){ int index = (high+low)/2; if( arr[index] < value ) { low = index+1; }else { high = index; } } return low; } }