publicstaticvoidmain(String[] args)throws Exception { BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(in.readLine()); out.write("" + tileOf2xn2(n)); out.write("\n"); out.flush(); out.close(); in.close(); } publicstaticinttileOf2xn2(int n){ int[] dp = newint[n+1]; dp[0] = 1; dp[1] = 1; for (int i = 2; i <= n; i++) { dp[i] = (dp[i-1] + (2*dp[i-2])) % 10007; } return dp[n]; } }