package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) const M = 998244353 func main() { buf := make([]byte, 1024*1024) sc.Buffer(buf, bufio.MaxScanTokenSize) sc.Split(bufio.ScanWords) defer out.Flush() a, n := nextInt(), nextInt() ans := pow(a, n, M) fmt.Fprintln(out, M) fmt.Fprintln(out, ans) } // nextInt int型で返す func nextInt() int { sc.Scan() i, _ := strconv.Atoi(sc.Text()) return i } // pow 累乗 func pow(a, b, m int) int { ret := 1 for b > 0 { if b%2 == 1 { ret = ret * a % m } b >>= 1 a = a * a % m } return ret }