#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
long long mul(long long a, long long b) { return (a * b) % (1000003); }
long long add(long long a, long long b) { return (a + b) % (1000003); }
long long sub(long long a, long long b) {
  return ((a - b) % (1000003) + (1000003)) % (1000003);
}
void upd(long long &a, long long b) {
  a = (a % (1000003) + b % (1000003)) % (1000003);
}
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long calc(long long k) {
  long long t = 0;
  while (k) {
    t = (t + k / 2);
    k /= 2;
  }
  return t;
}
long long pow2(long long a, long long b, long long p) {
  if (b == 0) return 1 % p;
  if (b == 1) return a % p;
  long long c = pow2(a, b / 2, p) % p;
  c = c * c % p;
  if (b & 1) c = c * a % p;
  return c % p;
}
long long inv(long long a, long long p) { return pow2(a, p - 2, p); }
int main() {
  long long n, k;
  cin >> n >> k;
  if (n < 63 && (1LL << n) < k)
    puts("1 1");
  else {
    long long tmp = calc(k - 1);
    long long Inv = inv(pow2(2, tmp, (1000003)), (1000003));
    long long b = pow2(2, n, (1000003)), a = 1;
    for (long long i = 1; i <= k - 1; i++) {
      long long c = sub(b, i);
      a = mul(a, c);
      if (a == 0) break;
    }
    b = pow2(b, k - 1, (1000003));
    b = mul(b, Inv);
    a = mul(a, Inv);
    a = sub(b, a);
    cout << a << ' ' << b << endl;
  }
  return 0;
}
