https://www.acmicpc.net/problem/11727
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] dp = new int[n + 1];
dp[1] = 1; // 2 x 1์ผ๋
if (n >= 2) dp[2] = 3; // 2 x 2์ผ๋
for (int i = 3; i <= n; i++) {
dp[i] = (dp[i - 1] + 2 * dp[i - 2]) % 10007; // ์ ํ์
}
System.out.println(dp[n]);
}
}