#include <bits/stdc++.h>
using namespace std;
const long long lINF = 1000000000000000000;
const long long mod = 1000003;
const int INF = 1000000000;
long long bits(long long n) {
  long long ans = 0;
  for (long long i = 0; i < 64; i++) {
    if (n & 1) ans++;
    n >>= 1;
  }
  return ans;
}
long long bin_pow(long long a, long long exp) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    exp >>= 1;
  }
  return ans;
}
int main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  if (n <= 62 && (1ll << n) < k) {
    cout << 1 << ' ' << 1;
    return 0;
  }
  long long gcd = (k - 1) - bits(k - 1);
  long long modn = n % (mod - 1);
  long long modk = k % (mod - 1);
  long long modgcd = gcd % (mod - 1);
  long long denp = (modn * (modk - 1) - modgcd) % (mod - 1);
  if (denp < 0) denp += mod - 1;
  long long num = 0;
  if (k - 1 < mod) {
    num = bin_pow(2, mod - 2);
    long long buf = bin_pow(2, modn);
    num = bin_pow(num, modgcd) % mod;
    for (auto(i) = (1); (i) < (k); (i)++) num = (num * (buf - i)) % mod;
  }
  num = (bin_pow(2, denp) - num) % mod;
  if (num < 0) num += mod;
  cout << num << ' ' << bin_pow(2, denp);
  return 0;
}
