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.Sort(); var MAX_Y = Y.Max(); foreach (var x in X) { if (MAX_Y < x) { Console.WriteLine("Infinity"); continue; } foreach (var y in Y) { if (y > x) { Console.WriteLine(y - x); break; } } } } } }