import java.util.Scanner; public class HelloWorld { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); sc.close(); long e = 1; for (int i = 0; i < n; i ++) { e = e * 10 + 3; } System.out.println(e % 1000000007); } }