#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000003;
long long n, k, pw;
bool check(void) {
  long long temp = 1;
  for (long long i = 1; i <= n; i++) {
    temp *= 2;
    if (temp >= k) return false;
  }
  return true;
}
long long getpw(long long n) {
  if (n == 0)
    return 1;
  else {
    long long ans = getpw(n / 2);
    if (n % 2 == 1)
      return (ans * ans * 2) % mod;
    else
      return (ans * ans) % mod;
  }
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  if (check()) {
    printf("%d %d\n", 1, 1);
    return 0;
  }
  long long temp = k - 1;
  while (temp > 0) {
    temp /= 2;
    pw += temp;
  }
  long long ans = 1;
  if (k - 1 < mod) {
    for (long long i = 1; i < k; i++) {
      temp = i;
      long long sum = 0;
      while (temp % 2 == 0) temp /= 2, sum++;
      ans = ans * (getpw(n - sum) - temp) % mod;
    }
    if (ans < 0) ans += mod;
  } else
    ans = 0;
  long long temp1 = ((k - 1) % (mod - 1)) * (n % (mod - 1)) % (mod - 1);
  temp1 -= pw % (mod - 1);
  if (temp1 < 0) temp1 += mod - 1;
  temp = getpw(temp1);
  long long a = temp - ans;
  if (a < 0) a += mod;
  printf("%I64d %I64d\n", a, temp);
  return 0;
}
