#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
const int MAXN = 1e3 + 5;
const long long MOD = 1e6 + 3;
const double eps = 1e-7;
const double PI = acos(-1);
using namespace std;
long long Scan_LL() {
  long long res = 0, ch, flag = 0;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + ch - '0';
  return flag ? -res : res;
}
int Scan_Int() {
  int res = 0, ch, flag = 0;
  if ((ch = getchar()) == '-')
    flag = 1;
  else if (ch >= '0' && ch <= '9')
    res = ch - '0';
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + ch - '0';
  return flag ? -res : res;
}
void Out(long long a) {
  if (a > 9) Out(a / 10);
  putchar(a % 10 + '0');
}
long long Multi(long long a, long long b) {
  long long ans = 0;
  while (b) {
    if (b & 1) ans = (ans + a) % (MOD - 1);
    b >>= 1LL;
    a = (a + a) % (MOD - 1);
  }
  return ans;
}
long long quick(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % MOD;
    b >>= 1LL;
    a = (a * a) % MOD;
  }
  return ans;
}
void Exgcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  long long x1, y1;
  Exgcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - (a / b) * y1;
}
int main() {
  long long Inv, y;
  Exgcd(2, MOD, Inv, y);
  Inv = (Inv % MOD + MOD) % MOD;
  long long n, k;
  while (cin >> n >> k) {
    if (n < 63LL) {
      if (k > (1LL << n))
        puts("1 1");
      else {
        long long ans = 0, fm = k, tmp;
        fm--;
        while (fm) {
          fm >>= 1LL;
          ans += fm;
        }
        fm = k - 1LL;
        fm = Multi(n, fm);
        fm = (fm - ans) % (MOD - 1);
        fm = (fm % (MOD - 1) + (MOD - 1)) % (MOD - 1);
        fm = quick(2LL, fm);
        if (k > MOD) {
          cout << fm << " " << fm << endl;
          continue;
        }
        tmp = quick(2LL, n);
        long long fz = 1;
        for (long long i = 1; i < k; i++) fz = fz * (tmp - i) % MOD;
        fz = (fz % MOD + MOD) % MOD;
        fz = fz * quick(Inv, ans) % MOD;
        fz = fm - fz;
        fz = (fz % MOD + MOD) % MOD;
        cout << fz << " " << fm << endl;
      }
    } else {
      long long ans = 0, fm = k, tmp;
      fm--;
      while (fm) {
        fm >>= 1LL;
        ans += fm;
      }
      fm = k - 1LL;
      fm = Multi(n, fm);
      fm = (fm - ans) % (MOD - 1);
      fm = (fm % (MOD - 1) + (MOD - 1)) % (MOD - 1);
      fm = quick(2LL, fm);
      if (k > MOD) {
        cout << fm << " " << fm << endl;
        continue;
      }
      tmp = quick(2LL, n);
      long long fz = 1;
      for (long long i = 1; i < k; i++) fz = fz * (tmp - i) % MOD;
      fz = fz * quick(Inv, ans) % MOD;
      fz = fm - fz;
      fz = (fz % MOD + MOD) % MOD;
      cout << fz << " " << fm << endl;
    }
  }
  return 0;
}
