import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //FastScanner scanner=new FastScanner(); PrintWriter out = new PrintWriter(System.out); int[] t=new int[1000000]; t[3]=1; for(int i=4; i<1000000; i++) { t[i]=(t[i-1]+t[i-2]+t[i-3]+t[i-4])%17; } int d=0; for(int i=1; i<999996; i++) { boolean dame=false; for(int j=0; j<4; j++) { if(t[i+j]!=t[j]) { dame=true; break; } } if(!dame) { d=i; break; } } //out.println(d); int q=scanner.nextInt(); for(int i=0; i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next()); } }