using System; public class Hello { public static void Main() { var a = new int[4913]; a[4] = 1; tetraset(a); var q = int.Parse(Console.ReadLine().Trim()); for (int i = 0; i < q; i++) { var n = long.Parse(Console.ReadLine().Trim()); var w = (int)(n % 4912L); Console.WriteLine(a[w]); } } public static void tetraset(int[] a) { for (int i = 5; i <= 4912; i++) a[i] = (a[i - 1] + a[i - 2] + a[i - 3] + a[i - 4]) % 17; } }