import static java.lang.System.err; import static java.lang.System.out; public class Main { public static void main(String[] args) { new Main(); out.flush(); err.flush(); } public static long pow(long a, long b, int M) { if (b == 0) return 1; if (b == 1) return a % M; if (b == 2) return a * a % M; return pow(pow(a, 2, M), b >> 1, M) * pow(a, b & 1, M) % M; } public Main() { try (java.util.Scanner sc = new java.util.Scanner(System.in)) { int a = sc.nextInt(); long n = sc.nextLong(); final int M = 998_244_353; out.println(M); out.println(pow(a, n, M)); } } }