#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e6 + 3;
void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int sum(int a, int b) {
  add(a, b);
  return a;
}
int mult(int a, int b) { return (1ll * a * b) % mod; }
long long n, k;
bool check(long long n, long long k) {
  long long nw = 1;
  for (long long i = 1; i <= n; i++) {
    nw *= 2ll;
    if (nw >= k) return 0;
  }
  return 1;
}
int bp(int a, long long n) {
  int ans = 1;
  while (n) {
    if (n & 1) ans = mult(ans, a);
    a = mult(a, a);
    n >>= 1;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  clock_t start = clock();
  cin >> n >> k;
  if (check(n, k)) {
    cout << 1 << " " << 1 << endl;
    return 0;
  }
  if (k == 1) {
    cout << 0 << " " << 1 << endl;
    return 0;
  }
  int a, b;
  b = bp(2, n);
  b = bp(b, k);
  if (k < mod) {
    int now = bp(2, n);
    a = 1;
    for (int i = 0; i < k; i++) a = mult(a, sum(now, mod - i));
  } else {
    a = 1;
    int now = bp(2, n);
    for (int i = 0; i < mod; i++)
      a = mult(a, mult(sum(1, ((k - i) / mod) % mod), sum(now, mod - i)));
  }
  long long x = k - 1;
  long long g = n % (mod - 1);
  while (x) {
    g += x / 2;
    g %= (mod - 1);
    x /= 2;
  }
  g = bp(2, g);
  a = mult(a, bp(g, mod - 2));
  b = mult(b, bp(g, mod - 2));
  a = sum(b, mod - a);
  cout << a << " " << b << endl;
  double duration = ((double)clock() - start) / (double)CLOCKS_PER_SEC;
  return 0;
}
