#include <bits/stdc++.h>
using namespace std;
long long IN() {
  int c, f;
  long long x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
const int p = 1e6 + 3;
const int q = p - 1;
long long n, k, tmp;
int a, b, num;
int Pow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % p)
    if (b & 1) res = 1ll * res * a % p;
  return res;
}
int main() {
  n = IN(), k = IN();
  if (n <= 60 && k > 1ll << n) {
    puts("1 1");
    return 0;
  }
  a = 1;
  for (long long i = 0; i < k && a; i++) {
    if (i == 0) {
      num = (num + n) % q;
    } else {
      long long x = n, y = i;
      while (y % 2 == 0) x--, y /= 2, num = (num + 1) % q;
      x %= q, y %= p;
      a = 1ll * a * (Pow(2, x) - y + p) % p;
    }
  }
  if (a == 0) {
    k--;
    num = 1ll * (n % q) * (k % q) % q;
    while (k) num = (num - k / 2 + q) % q, k /= 2;
    printf("%d %d\n", Pow(2, num), Pow(2, num));
  } else {
    b = Pow(2, (1ll * (n % q) * (k % q) % q - num + q) % q);
    printf("%d %d\n", (b - a + p) % p, b);
  }
}
