#include <bits/stdc++.h>
using namespace std;
long long M = 1e6 + 3;
long long mpe(long long base, long long exponent, long long modulus) {
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = result * base % modulus;
    exponent = exponent >> 1;
    base = base * base % modulus;
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  long long tm = k - 1, cnt = 0;
  while (tm) {
    cnt += (tm / 2);
    tm /= 2;
  }
  if (n < 61 && mpe(2, n, 5e18) < k) {
    cout << 1 << " " << 1;
    return 0;
  }
  long long a, b;
  b = mpe(2, n, M);
  b = mpe(b, k - 1, M);
  b %= M;
  long long tmp = mpe(2, cnt, M);
  b *= mpe(tmp, M - 2, M);
  b %= M;
  if (k > M) {
    cout << b << " " << b;
    return 0;
  }
  a = mpe(2, n, M);
  a = mpe(a, k - 1, M);
  tm = mpe(2, n, M);
  long long tm1;
  tm1 = tm - (k - 1);
  tm1 = (tm1 + 2 * M) % M;
  tm = 1;
  for (long long i = 0; i < k - 1; ++i) {
    tm *= tm1;
    tm %= M;
    tm1++;
  }
  a = (a - tm + M) % M;
  a *= mpe(tmp, M - 2, M);
  a %= M;
  cout << a << " " << b;
  return 0;
}
