#include <bits/stdc++.h>
using namespace std;
long long prod(long long a, long long b) { return (a * b) % 1000003; }
long long exponate(long long base, long long exp) {
  long long out = 1;
  while (exp > 0) {
    if (exp % 2 == 1) {
      out = prod(base, out);
    }
    base = prod(base, base);
    exp /= 2;
  }
  return out;
}
long long getExtraTwos(long long in) {
  long long extraTwos = 0;
  long long powAdd = 2;
  long long sta = (in - 1) / 2;
  while (sta > 0) {
    if (sta % 2 == 1) {
      extraTwos += powAdd - 1;
    }
    powAdd *= 2;
    sta /= 2;
  }
  return extraTwos;
}
long long modulate(long long in) {
  return (in + 1000003 * 1000000000000) % 1000003;
}
int main() {
  long long n, k;
  scanf("%I64d %I64d", &n, &k);
  bool done = false;
  if (n < 62) {
    long long pow = 1;
    for (long long i = 0; i < n; i++) pow *= (long long)2;
    if (k > pow) {
      printf("1 1");
      done = true;
    }
  }
  if (!done && k == 1) {
    printf("0 1");
    done = true;
  }
  if (!done) {
    long long a, b;
    long long extraTwos = getExtraTwos(k);
    long long twoUpN = exponate(2, n);
    long long start = modulate(twoUpN - k + 1);
    long long end = modulate(twoUpN - 1);
    long long completeCycles = k / 1000003;
    a = 0;
    if (start <= end && start > 0 && completeCycles == 0) {
      a = 1;
      for (long long i = start; i <= end; i++) {
        a = prod(a, i);
      }
    }
    b = exponate(
        2, ((n % (1000003 - 1)) * ((k - 1) % (1000003 - 1))) % (1000003 - 1));
    b = prod(b, exponate(500002, extraTwos));
    a = prod(a, exponate(500002, extraTwos));
    a = modulate(b - a);
    printf("%I64d %I64d", a, b);
  }
  scanf("%d", n);
}
