#include <bits/stdc++.h>
using namespace std;
const int mod = 1000003, phi_mod = 1000002;
int ans1, ans2;
long long n, k;
int fpow(int i, int j) {
  int ret = 1;
  for (; j; i = (long long)i * i % mod, j /= 2)
    if (j & 1) ret = (long long)ret * i % mod;
  return ret;
}
int main() {
  int i, j, s = 0, s1;
  scanf("%I64d %I64d", &n, &k);
  if (n < 63 && k > (1LL << n)) {
    printf("%d %d\n", 1, 1);
    return 0;
  }
  s = 0;
  if (n >= 64) {
    s = (n - 63) % phi_mod;
  }
  for (i = min((long long)63, n); i >= 1; i--)
    s = (s + ((k - 1) / (1LL << i) + 1) % phi_mod) % phi_mod;
  ans2 = fpow(2, (n % phi_mod) * (k % phi_mod) % phi_mod + (phi_mod - s));
  s1 = fpow(2, n % phi_mod);
  ans1 = 1;
  for (i = 0; i < mod; i++) ans1 = (long long)ans1 * (s1 - i) % mod;
  ans1 = fpow(ans1, (k / mod) % phi_mod);
  for (i = k - 1; (i + 1) % mod != 0; i--)
    ans1 = (long long)ans1 * (s1 - i) % mod;
  ans1 = (long long)ans1 * fpow(fpow(2, s), mod - 2) % mod;
  ans1 = (ans2 - ans1 + mod) % mod;
  printf("%d %d\n", ans1, ans2);
  return 0;
}
