using System; using System.Collections.Generic; using System.Linq; class prog { static void Main() { var n=long.Parse(Console.ReadLine()).Validate(x=>1(this T input, Func f) { if (!f(input)) throw new Exception("invalid input"); return input; } static public T[] ValidateArray(this T[] input, Func f) { foreach (var x in input) if (!f(x)) throw new Exception("invalid input"); return input; } }