#include <bits/stdc++.h>
const int Mod = 1000003, Phi = 1000002, Inv2 = 500002;
int qPow(int b, int e) {
  int a = 1;
  for (; e; e >>= 1, b = (long long)b * b % Mod)
    if (e & 1) a = (long long)a * b % Mod;
  return a;
}
long long N, K;
int main() {
  scanf("%lld%lld", &N, &K), --K;
  if (N <= 59 && K >= (1ll << N)) return puts("1 1"), 0;
  long long cnt = K, J = K;
  for (; J; J >>= 1)
    if (J & 1) --cnt;
  int B = qPow(2, ((N % Phi) * (K % Phi) % Phi - cnt % Phi + Phi) % Phi);
  if (K >= Mod) return printf("%d %d\n", B, B), 0;
  int A = qPow(Inv2, cnt), _2N = qPow(2, N % Phi);
  for (int i = 1; i <= K; ++i) A = (long long)A * (_2N - i + Mod) % Mod;
  printf("%d %d\n", (B - A + Mod) % Mod, B);
  return 0;
}
