import java.util.Scanner; public class Program { public static void main(String[] args) { new Magatro().solve(); } } class Magatro { private long n; private int MOD = 1000000007; private long[] anser = new long[] { 0l, 1l, 101l, 10101l, 1010101l, 101010101l, 10101010101l, 1010101010101l, 101010101010101l, 10101010101010101l, 1010101010101010101l }; private void scan() { Scanner scanner = new Scanner(System.in); n = scanner.nextLong(); } public void solve() { scan(); System.out.println(function(n, MOD)); System.out.println(anser[(int) (n % 11)]); } private long function(long i, long mod) { if (i == 0) { return 0; } if (i == 1) { return 1; } if (i % 2 == 1) { long res = function(i - 1, mod) * 100 + 1; res %= mod; return res; } else { long res = function(i / 2, mod); res *= pow(100, i / 2, mod) + 1; res %= mod; return res; } } private long pow(long a, long b, long mod) { long result = 1; while (b > 0) { if (b % 2 == 1) { result *= a; result %= mod; } a *= a; a %= mod; } return result; } }