#include <bits/stdc++.h>
using namespace std;
const int MODA = 1000003;
inline void print(char pt) { printf("%c\n", pt); }
inline void print(int pt) { printf("%d\n", pt); }
inline void print(long long pt) { printf("%I64d\n", pt); }
inline void print(double pt) { printf("%.20f\n", pt); }
inline void print(char pt[]) { printf("%s\n", pt); }
inline void print() { printf("\n"); }
inline void scan(int &pt) { scanf("%d", &pt); }
inline void scan(char &pt) { scanf("%c", &pt); }
inline void scan(long long &pt) { scanf("%I64d", &pt); }
inline void scan(double &pt) { scanf("%lf", &pt); }
inline void scan(char pt[]) { scanf("%s", pt); }
long long qpow(long long x, long long y) {
  x %= MODA;
  long long res = 1;
  while (y) {
    if (y % 2 == 1) {
      res *= x;
      res %= MODA;
    }
    x = x * x;
    x %= MODA;
    y /= 2;
  }
  return res;
}
long long extend_gcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0 && b == 0) return -1;
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extend_gcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
long long mod_reverse(long long a, long long MOD) {
  long long x, y;
  long long d = extend_gcd(a, MOD, x, y);
  if (d == 1)
    return (x % MOD + MOD) % MOD;
  else
    return -1;
}
void fail() {
  print("1 1");
  exit(0);
}
int mrs[1000008];
void getmodreserve() {
  for (int i = 0; i < MODA; i++) {
    mrs[i] = mod_reverse(i, MODA);
  }
}
int cnt2[1000008];
int vis[1000008];
void get2s() {
  for (int i = 1; i < MODA; i++) {
    if (vis[i]) continue;
    for (int j = i, cnt = 0; j < MODA; j *= 2) {
      vis[j] = 1;
      cnt2[j] = cnt;
      cnt++;
    }
  }
}
int p2[1000008];
void getq2() {
  int ti = 1;
  for (int i = 0; i < MODA; i++) {
    p2[i] = ti;
    ti *= 2;
    ti %= MODA;
  }
}
int T;
long long n, k;
int main() {
  scan(n);
  scan(k);
  long long ti = 1;
  for (int i = 0; i < n; i++) {
    if (ti >= k) break;
    ti *= 2;
  }
  if (ti < k) fail();
  get2s();
  getmodreserve();
  getq2();
  long long t = qpow(2, n);
  long long ansa = 1;
  int i = 0;
  long long tk = k;
  ansa *= mrs[t];
  ansa %= MODA;
  while (tk--) {
    ansa *= t;
    ansa *= mrs[p2[cnt2[i]]];
    ansa %= MODA;
    t--;
    i++;
    if (ansa == 0) {
      break;
    }
  }
  long long mk = 0;
  ti = 2;
  while (ti <= k - 1) {
    mk += (k - 1) / ti;
    ti <<= 1;
  }
  long long ansb = qpow(qpow(2, n), k - 1) * mod_reverse(qpow(2, mk), MODA);
  ansb %= MODA;
  ansa = ansb - ansa;
  while (ansa < 0) ansa += MODA;
  print(ansa);
  print(ansb);
  return 0;
}
