#include <bits/stdc++.h>
using namespace std;
const int mod = 1000003;
long long quickpowmod(long long x, long long y, long long mo) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = ret * x % mo;
    x = x * x % mo;
    y >>= 1;
  }
  return ret;
}
int main() {
  std ::ios ::sync_with_stdio(false);
  long long n, k, ans1, ans2;
  while (cin >> n >> k) {
    if (n <= 60 && k > (1ll << n)) {
      printf("1 1\n");
      continue;
    }
    long long i = 0;
    long long j = k - 1;
    while (j) {
      j /= 2;
      i += j;
    }
    ans1 = 1;
    long long s = quickpowmod(2, n, mod);
    long long t = s;
    for (int i = 1; i <= k - 1; i++) {
      ans1 = (ans1 * (--s)) % mod;
      if (!ans1) break;
    }
    long long ss = quickpowmod(quickpowmod(2, i, mod), mod - 2, mod);
    ans1 = (ans1 * ss) % mod;
    ans2 = quickpowmod(t, (k - 1), mod);
    ans2 = (ans2 * ss) % mod;
    ans1 = (ans2 - ans1 + mod) % mod;
    cout << ans1 << " " << ans2 << endl;
  }
  return 0;
}
