using System; using System.Linq; namespace Sample { class Program { static void Main(string[] args) { var arr = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray(); var (N, M) = (arr[0], arr[1]); var X = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); var Y = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); Y.OrderBy(x => x); string Binary_search(long key) { int left = 0, right = (int)Y.Count() - 1; while (right >= left) { int mid = left + (right - left) / 2; if (Y[mid] > key) right = mid - 1; else left = mid + 1; } var ans = (right < M - 1) ? (Y[right + 1] - key).ToString() : "Infinity"; return ans; } X.ForEach(x => Console.WriteLine(Binary_search(x))); } } }