let power m n =
  let rec doit m n acc =
    if n = 0 then acc
    else if n mod 2 = 0 then doit (m * m) (n / 2) acc
    else doit m (n - 1) (acc * m) in
  doit m n 1

let () =
  let (m, n) = Scanf.scanf "%d %d\n" (fun m n -> (m, n)) in
  Printf.printf "%d\n" (power m n)