import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] input = br.readLine().split(" "); BigInteger a = new BigInteger(input[0]); BigInteger n = new BigInteger(input[1]); BigInteger M = new BigInteger("10000000000"); System.out.println(M); System.out.println(a.modPow(n, M)); } }