#include <bits/stdc++.h>
using namespace std;
long long n, k, s;
int f_z, fm, ny;
int Pow(int x, long long k) {
  int ans = 1;
  for (; k; k >>= 1, x = 1LL * x * x % 1000003)
    if (k & 1) ans = 1LL * ans * x % 1000003;
  return ans;
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  if (n <= 60)
    if ((1ll << n) < k) return printf("1 1\n"), 0;
  fm = Pow(Pow(2, n), k - 1), f_z = 1, ny = Pow(2, 1000003 - 2);
  int tmp = (Pow(2, n) + 1000003 - 1) % 1000003;
  if (--k, tmp >= k) {
    while (k) {
      s++;
      int t = s;
      while (t % 2 == 0) {
        t /= 2;
        fm = 1LL * fm * ny % 1000003;
        f_z = 1LL * f_z * ny % 1000003;
      }
      f_z = 1LL * tmp * f_z % 1000003;
      tmp--;
      k--;
    }
    f_z = fm - f_z;
    if (f_z < 0) f_z += 1000003;
    printf("%d %d\n", f_z, fm);
  } else {
    while (k) s += k / 2, k /= 2;
    fm = 1LL * fm * Pow(ny, s) % 1000003;
    printf("%d %d\n", fm, fm);
  }
}
