/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	ll inv=1;
	while((inv<<1)<=k) inv<<=1;
	inv=inv*2-1;
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k,qmod(n,2));
	if(x-k+1<=0)
		A=0;
	else for(ll i=x;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	ll c=__gcd(A,B);
	A/=c;
	B/=c;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

bool ok()
{
	int c=k;
	int ret=0;
	while(c)
	{
		ret++;
		c>>=1;
	}
	return ret>n;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	if(ok())
	{
		puts("1 1");
		return 0;
	}
	ll inv=0;
	ll c=2;
	while(c<=k-1)
	{
		inv+=(k-1)/c;
		c<<=1;
	}
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k-1,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x-1;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	ll inv=0;
	ll c=2;
	while(c<=k-1)
	{
		inv+=(k-1)/c;
		c<<=1;
	}
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k-1,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x-1;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

bool ok()
{
	ll c=k;
	ll ret=0;
	while(c>=2)
	{
		ret++;
		c>>=1;
	}
	return ret>n;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	if(ok())
	{
		puts("1 1");
		return 0;
	}
	ll inv=0;
	ll c=2;
	while(c<=k-1)
	{
		inv+=(k-1)/c;
		c<<=1;
	}
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k-1,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x-1;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k,qmod(n,2));
	if(x-k+1<=0)
		A=0;
	else for(ll i=x;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

bool ok()
{
	ll c=n;
	ll ret=1;
	while(c)
	{
		ret<<=1;
		--c;
		if(ret>=k)
			return false;
	}
	return true;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	if(ok())
	{
		puts("1 1");
		return 0;
	}
	ll inv=0;
	ll c=2;
	while(c<=k-1)
	{
		inv+=(k-1)/c;
		c<<=1;
	}
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k-1,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x-1;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


/*===============================================================
*  Filename：711e.cpp
*  Author：zhuyutian
*  Date：2016年09月20日
================================================================*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod=1e6+3;
ll n,k;

ll qmod(ll x,ll tmp)
{
	ll ret=1;
	while(x)
	{
		if(x&1) ret=ret*tmp%mod;
		tmp=tmp*tmp%mod;
		x>>=1;
	}
	return ret;
}

bool ok()
{
	ll c=k;
	ll ret=0;
	while(c)
	{
		ret++;
		c>>=1;
	}
	return ret>n;
}

int main()
{
	scanf("%I64d%I64d",&n,&k);
	if(ok())
	{
		puts("1 1");
		return 0;
	}
	ll inv=0;
	ll c=2;
	while(c<=k-1)
	{
		inv+=(k-1)/c;
		c<<=1;
	}
	inv=qmod(inv,2);
	inv=qmod(mod-2,inv);
	const ll x=qmod(n,2);
	ll A=1,B=qmod(k-1,x);
	if(x-k+1<=0)
		A=0;
	else for(ll i=x-1;i>=x-k+1;i--)
			A=A*i%mod;
	A=(B-A+mod)%mod;
	//cout<<A<<" "<<B<<" "<<inv<<endl;
	A=A*inv%mod;
	B=B*inv%mod;
	printf("%I64d %I64d\n",A,B);
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e6 + 3;

ll ex[int(mod + 10)];

ll expo(ll x, ll e) {
    if (e == 0) return 1;
    if (e%2) return (x*expo((x*x)%mod, e/2))%mod;
    return (expo((x*x)%mod, e/2))%mod;
}

ll inv(ll x) {
    return expo(x, mod - 2);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ex[0] = 1;
    for (int i = 1; i < mod; ++i) ex[i] = (ex[i-1]*2ll)%mod;

    ll n, k;
    cin >> n >> k;

    if (n < 64 and 1ll<<n < k) {
        cout << "1 1" << endl;
        return 0;
    }

    ll dos = ex[(n%(mod-1))];
    ll B = ex[((n%(mod-1))*(k%(mod-1)))%(mod-1)];
    ll A = 1;
//     cerr << dos << endl;
//     cerr << B << endl;
    if (k > dos) A = 0;
    else {
        for (int i = 0; i < k; ++i) {
            A = (A*(dos - i))%mod;
        }
    }
    ll q = n;
    --k;
    while (k > 0) {
        k /= 2;
        q += k;
    }

    A = (A*inv(expo(2, q)))%mod;
    B = (B*inv(expo(2, q)))%mod;

    A = (B - A + mod)%mod;

    cout << A << ' ' << B << endl;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e6 + 3;

ll ex[int(mod + 10)];

ll expo(ll x, int e) {
    if (e == 0) return 1;
    if (e%2) return (x*expo((x*x)%mod, e/2))%mod;
    return (expo((x*x)%mod, e/2))%mod;
}

ll inv(ll x) {
    return expo(x, mod - 2);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ex[0] = 1;
    for (int i = 1; i < mod; ++i) ex[i] = (ex[i-1]*2ll)%mod;

    int n, k;
    cin >> n >> k;

    if (n < 64 and 1ll<<n < k) {
        cout << "1 1" << endl;
        return 0;
    }

    ll dos = ex[(n%(mod-1))];
    ll B = ex[((n%(mod-1))*(k%(mod-1)))%(mod-1)];
    ll A = 1;
//     cerr << dos << endl;
//     cerr << B << endl;
    if (k > dos) A = 0;
    else {
        for (int i = 0; i < k; ++i) {
            A = (A*(dos - i))%mod;
        }
    }
    ll q = n;
    --k;
    while (k > 0) {
        k /= 2;
        q += k;
    }

    A = (A*inv(expo(2, q)))%mod;
    B = (B*inv(expo(2, q)))%mod;

    A = (B - A + mod)%mod;

    cout << A << ' ' << B << endl;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e6 + 3;

ll ex[int(mod + 10)];

ll expo(ll x, int e) {
    if (e == 0) return 1;
    if (e%2) return (x*expo((x*x)%mod, e/2))%mod;
    return (expo((x*x)%mod, e/2))%mod;
}

ll inv(ll x) {
    return expo(x, mod - 2);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll res = -1;
    ex[0] = 1;
    for (int i = 1; i <= mod; ++i) {
      ex[i] = (ex[i-1]*2ll)%mod;
      if (ex[i] == 1 and res == -1) res = i;
    }

    ll n, k;
    cin >> n >> k;

    if (n < 64 and 1ll<<n < k) {
        cout << "1 1" << endl;
        return 0;
    }

    ll dos = ex[(n%(res))];
    ll B = ex[((n%(res))*((k - 1)%(res)))%(res)];
    ll A = 1;
//     cerr << dos << endl;
//     cerr << B << endl;
    if (k > dos) A = 0;
    else {
        for (ll i = 1; i < k; ++i) {
            A = (A*(dos - i))%mod;
        }
    }
    ll q = 0;
    --k;
    while (k > 0) {
        k /= 2;
        q += k;
    }

    A = (A*inv(ex[q%res]))%mod;
    B = (B*inv(ex[q%res]))%mod;

    A = (B - A + mod)%mod;

    cout << A << ' ' << B << endl;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e6 + 3;

ll ex[int(mod + 10)];

ll expo(ll x, int e) {
    if (e == 0) return 1;
    if (e%2) return (x*expo((x*x)%mod, e/2))%mod;
    return (expo((x*x)%mod, e/2))%mod;
}

ll inv(ll x) {
    return expo(x, mod - 2);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ex[0] = 1;
    for (int i = 1; i < mod; ++i) ex[i] = (ex[i-1]*2ll)%mod;

    ll n, k;
    cin >> n >> k;

    if (n < 64 and 1ll<<n < k) {
        cout << "1 1" << endl;
        return 0;
    }

    ll dos = ex[(n%(mod-1))];
    ll B = ex[((n%(mod-1))*(k%(mod-1)))%(mod-1)];
    ll A = 1;
//     cerr << dos << endl;
//     cerr << B << endl;
    if (k > dos) A = 0;
    else {
        for (int i = 0; i < k; ++i) {
            A = (A*(dos - i))%mod;
        }
    }
    ll q = n;
    --k;
    while (k > 0) {
        k /= 2;
        q += k;
    }

    A = (A*inv(expo(2, q)))%mod;
    B = (B*inv(expo(2, q)))%mod;

    A = (B - A + mod)%mod;

    cout << A << ' ' << B << endl;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll mod = 1e6 + 3;

ll ex[int(mod + 10)];

ll expo(ll x, int e) {
    if (e == 0) return 1;
    if (e%2) return (x*expo((x*x)%mod, e/2))%mod;
    return (expo((x*x)%mod, e/2))%mod;
}

ll inv(ll x) {
    return expo(x, mod - 2);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ex[0] = 1;
    for (int i = 1; i < mod; ++i) ex[i] = (ex[i-1]*2ll)%mod;

    ll n, k;
    cin >> n >> k;

    if (n < 64 and 1ll<<n < k) {
        cout << "1 1" << endl;
        return 0;
    }

    ll dos = ex[(n%(mod-1))];
    ll B = ex[((n%(mod-1))*(k%(mod-1)))%(mod-1)];
    ll A = 1;
//     cerr << dos << endl;
//     cerr << B << endl;
    if (k > dos) A = 0;
    else {
        for (ll i = 0; i < k; ++i) {
            A = (A*(dos - i))%mod;
        }
    }
    ll q = n;
    --k;
    while (k > 0) {
        k /= 2;
        q += k;
    }

    A = (A*inv(expo(2, q)))%mod;
    B = (B*inv(expo(2, q)))%mod;

    A = (B - A + mod)%mod;

    cout << A << ' ' << B << endl;
}


#include <bits/stdc++.h>
using namespace std;

const int M = 1000003;

int pow_mod(int a, long long e)
{
	if (!e) return 1;
	long long t = pow_mod(a, e>>1);
	t = t*t % M;
	if (e&1) t = t*a % M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	// k >= 2^n?
	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		const static long long lim = 1e18+0.1;
		if (t>lim) break;
	}
	if (k>=t) {
		puts("1 1");
		return 0;
	}

	int yuefen = 0;

	int orz = pow_mod(2, n);
	int minus;
	if (k > orz)
		minus = 0;
	else {
		minus = 1;
		yuefen = n;
		for (int i = 1; i<k; i++) {
			int t = i;
			int thisyuefen = 0;
			while (~t&1) {t>>=1; yuefen++; thisyuefen++;}
			minus = 1ll * minus *
				((1ll * orz * pow_mod(500002, thisyuefen) % M - t + M) % M)
				% M;
		}
	}
	int tot = pow_mod(orz, k);
	tot = 1ll * tot * pow_mod(500002, yuefen) % M;
	int up = (tot - minus + M) % M;
	printf("%d %d\n", up, tot);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int M = 1000006;

int pow_mod(int a, long long e)
{
	if (!e) return 1;
	long long t = pow_mod(a, e>>1);
	t = t*t % M;
	if (e&1) t = t*a % M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	// k >= 2^n?
	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		const static long long lim = 1e18+0.1;
		if (t>lim) break;
	}
	if (k>=t) {
		puts("1 1");
		return 0;
	}

	int orz = pow_mod(2, n);
	int minus;
	if (k > orz)
		minus = 0;
	else {
		minus = 1;
		for (int i = 0; i<k; i++)
			minus = 1ll * minus * (orz-i) % M;
	}
	int tot = pow_mod(orz, k);
	int up = (tot - minus + M) % M;
	int g = __gcd(up, tot);
	up /= g;
	tot /= g;
	while (up>tot) up-=tot;
	printf("%d %d\n", up/g, tot/g);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int M = 1000003;

int pow_mod(int a, long long e)
{
	if (!e) return 1;
	long long t = pow_mod(a, e>>1);
	t = t*t % M;
	if (e&1) t = t*a % M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	// k >= 2^n?
	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		const static long long lim = 1e18+0.1;
		if (t>lim) break;
	}
	if (k>=t) {
		puts("1 1");
		return 0;
	}

	int yuefen = 0;

	int orz = pow_mod(2, n);
	int minus;
	if (k > orz)
		minus = 0;
	else {
		minus = 1;
		for (int i = 0; i<k; i++) {
			int t = orz-i;
			while (~t&1) {t>>=1; yuefen++;}
			minus = 1ll * minus * t % M;
		}
	}
	int tot = pow_mod(orz, k);
	tot = 1ll * tot * pow_mod(500002, yuefen) % M;
	int up = (tot - minus + M) % M;
	printf("%d %d\n", up, tot);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int M = 1e6+3.01;

int pow_mod(int a, int e)
{
	if (!e) return 1;
	long long t = pow_mod(a, e>>1);
	t = t*t % M;
	if (e&1) t = t*a % M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	// k >= 2^n?
	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		if (t>1e18) break;
	}
	if (k>=t) {
		puts("1 1");
		return 0;
	}

	int orz = pow_mod(2, n);
	int minus;
	if (k > orz)
		minus = 0;
	else {
		minus = 1;
		for (int i = 0; i<k; i++)
			minus = 1ll * minus * (orz-i) % M;
	}
	int tot = pow_mod(orz, k);
	int up = (tot - minus + M) % M;
	int g = __gcd(up, tot);
	printf("%d %d\n", up/g, tot/g);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const long long LIM = 1000000000000000000ll;
const int M = 1000003;

int fast_pow(int a, long long e)
{
	if (!e) return 1;
	long long t = fast_pow(a, e>>1);
	t = t*t%M;
	if (e&1) t = t*a%M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		if (t>LIM) break;
	}
	if (t<=k) {
		puts("1");
		return 0;
	}

	long long cnt2 = n;
	for (long long i = 2; i<=LIM; i+=i)
		cnt2 += (k-1) / i;
#define t t2
	int t;

	int orz = fast_pow(2, n);
	if (k > orz) t = 0;
	else {
		t = 1;
		for (int i = 1; i<k; i++) {
			int ii = i;
			int xx = 0;
			while (~ii&1) {ii>>=1; xx++;}
			t = (1ll * orz * fast_pow((M+1)/2, xx) - ii + M) % M * t % M;
		}
	}

	int otz = fast_pow(orz, k);
	int tot = 1ll * otz * fast_pow((M+1)/2, cnt2) % M;
	printf("%d %d\n", (tot-t+M)%M, tot);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int M = 1000006;

int pow_mod(int a, long long e)
{
	if (!e) return 1;
	long long t = pow_mod(a, e>>1);
	t = t*t % M;
	if (e&1) t = t*a % M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	// k >= 2^n?
	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		const static long long lim = 1e18+0.1;
		if (t>lim) break;
	}
	if (k>=t) {
		puts("1 1");
		return 0;
	}

	int orz = pow_mod(2, n);
	int minus;
	if (k > orz)
		minus = 0;
	else {
		minus = 1;
		for (int i = 0; i<k; i++)
			minus = 1ll * minus * (orz-i) % M;
	}
	int tot = pow_mod(orz, k);
	int up = (tot - minus + M) % M;
	int g = __gcd(up, tot);
	printf("%d %d\n", up/g, tot/g);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const long long LIM = 1000000000000000000ll;
const int M = 1000003;

int fast_pow(int a, long long e)
{
	if (!e) return 1;
	long long t = fast_pow(a, e>>1);
	t = t*t%M;
	if (e&1) t = t*a%M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		if (t>LIM) break;
	}
	if (t<k) {
		puts("1 1");
		return 0;
	}

	long long cnt2 = n;
	for (long long i = 2; i<=LIM; i+=i)
		cnt2 += (k-1) / i;
#define t t2
	int t;

	int orz = fast_pow(2, n);
	if (k > orz) t = 0;
	else {
		t = 1;
		for (int i = 1; i<k; i++) {
			int ii = i;
			int xx = 0;
			while (~ii&1) {ii>>=1; xx++;}
			t = (1ll * orz * fast_pow((M+1)/2, xx) - ii + M) % M * t % M;
		}
	}

	int otz = fast_pow(orz, k);
	int tot = 1ll * otz * fast_pow((M+1)/2, cnt2) % M;
	printf("%d %d\n", (tot-t+M)%M, tot);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const long long LIM = 1000000000000000000ll;
const int M = 1000003;

int fast_pow(int a, long long e)
{
	if (!e) return 1;
	long long t = fast_pow(a, e>>1);
	t = t*t%M;
	if (e&1) t = t*a%M;
	return t;
}

int main()
{
	long long n, k;
	cin >> n >> k;

	long long t = 1;
	for (int i = 0; i<n; i++) {
		t = t+t;
		if (t>LIM) break;
	}
	if (t<=k) {
		puts("1 1");
		return 0;
	}

	long long cnt2 = n;
	for (long long i = 2; i<=LIM; i+=i)
		cnt2 += (k-1) / i;
#define t t2
	int t;

	int orz = fast_pow(2, n);
	if (k > orz) t = 0;
	else {
		t = 1;
		for (int i = 1; i<k; i++) {
			int ii = i;
			int xx = 0;
			while (~ii&1) {ii>>=1; xx++;}
			t = (1ll * orz * fast_pow((M+1)/2, xx) - ii + M) % M * t % M;
		}
	}

	int otz = fast_pow(orz, k);
	int tot = 1ll * otz * fast_pow((M+1)/2, cnt2) % M;
	printf("%d %d\n", (tot-t+M)%M, tot);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll M=1e6+3;
const ll inv=(1e6+4)/2;
ll power(ll b, ll e){
    if (e==0) return 1;
    if (e==1) return b;
    ll ans=(power(b,e/2)*power(b,e/2))%M;
    if (e&1) ans=(ans*b)%M;
    return ans;
}
int main(){
    ios::sync_with_stdio(0);
    ll n,k; cin>>n>>k;
    ll res=1,p=0;
    while (res<k){
        res*=2; p++;
    } p--;
    //2^p < k
    if (n<=p) cout<<1<<' '<<1<<endl;
    else{
        //highest power of 2 dividing (k-1)!
        p=0; ll now=k-1,ex=2;
        while (ex<now){
            p+=ll(now/ex); ex*=2;
        }
        //cancel top and bottom by 2^p
        ll e=(n%(M-1))*((k-1)%(M-1)); e%=(M-1);
        e=(e-p%(M-1)+(M-1))%(M-1);
        ll a=1,b=power(2,e);
        if (k<M){
            ll tot=power(2,n);
            for (ll i=1;i<=k-1;i++) a=(a*(tot-i))%M;
            //divide by 2^p, i.e. multiply by inv^p
            a=(a*power(inv,p))%M;
        }
        else a=0;
        cout<<(b-a+M)%M<<' '<<b<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll M=1e6+3;
const ll inv=(1e6+4)/2;
ll power(ll b, ll e){
    if (e==0) return 1;
    if (e==1) return b;
    ll ans=(power(b,e/2)*power(b,e/2))%M;
    if (e&1) ans=(ans*b)%M;
    return ans;
}
int main(){
    ios::sync_with_stdio(0);
    ll n,k; cin>>n>>k;
    ll res=1,p=0;
    while (res<k){
        res*=2; p++;
    } p--;
    //2^p < k
    if (n<=p) cout<<1<<' '<<1<<endl;
    else{
        //highest power of 2 dividing (k-1)!
        p=0; ll now=k-1;
        while (now){
            now/=2; p+=now;
        }
        //cancel top and bottom by 2^p
        ll a=1,b=power(2,(n*(k-1)-p)%(M-1));
        if (k<M){
            ll tot=power(2,n);
            for (ll i=1;i<=k-1;i++) a=(a*(tot-i))%M;
            //divide by 2^p, i.e. multiply by inv^p
            a=(a*power(inv,p))%M;
        }
        cout<<(b-a+M)%M<<' '<<b<<endl;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll M=1e6+3;
const ll inv=(1e6+4)/2;
ll power(ll b, ll e){
    e%=M-1;
    if (e==0) return 1;
    if (e==1) return b;
    ll ans=(power(b,e/2)*power(b,e/2))%M;
    if (e&1) ans=(ans*b)%M;
    return ans;
}
int main(){
    ios::sync_with_stdio(0);
    ll n,k; cin>>n>>k;
    ll res=1,p=0;
    while (res<k){
        res*=2; p++;
    } p--;
    //2^p < k
    if (n<=p) cout<<1<<' '<<1<<endl;
    else{
        //highest power of 2 dividing (k-1)!
        p=0; ll now=k-1;
        while (now){
            now/=2; p+=now;
        }
        //cancel top and bottom by 2^p
        ll a=1,b=power(2,n*(k-1)-p);
        if (k<M){
            ll tot=power(2,n);
            for (ll i=1;i<=k-1;i++) a=(a*(tot-i))%M;
            //divide by 2^p, i.e. multiply by inv^p
            a=(a*power(inv,p))%M;
        }
        cout<<(b-a+M)%M<<' '<<b<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll M=1e6+3;
const ll inv=(1e6+4)/2;
ll power(ll b, ll e){
    e%=M-1;
    if (e==0) return 1;
    if (e==1) return b;
    ll ans=(power(b,e/2)*power(b,e/2))%M;
    if (e&1) ans=(ans*b)%M;
    return ans;
}
int main(){
    ios::sync_with_stdio(0);
    ll n,k; cin>>n>>k;
    ll res=1,p=0;
    while (res<k){
        res++; p++;
    } p--;
    //2^p < k
    if (n<=p) cout<<1<<' '<<1<<endl;
    else{
        //highest power of 2 dividing (k-1)!
        p=0; ll now=k-1;
        while (now){
            now/=2; p+=now;
        }
        //cancel top and bottom by 2^p
        ll a=1,b=power(2,n*(k-1)-p);
        if (k<M){
            ll tot=power(2,n);
            for (ll i=1;i<=k-1;i++) a=(a*(tot-i))%M;
            //divide by 2^p, i.e. multiply by inv^p
            a=(a*power(inv,p))%M;
        }
        cout<<(b-a+M)%M<<' '<<b<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

const ll M=1e6+3;
const ll inv=(1e6+4)/2;
ll power(ll b, ll e){
    if (e==0) return 1;
    if (e==1) return b;
    ll ans=(power(b,e/2)*power(b,e/2))%M;
    if (e&1) ans=(ans*b)%M;
    return ans;
}
int main(){
    ios::sync_with_stdio(0);
    ll n,k; cin>>n>>k;
    ll res=1,p=0;
    while (res<k){
        res*=2; p++;
    } p--;
    //2^p < k
    if (n<=p) cout<<1<<' '<<1<<endl;
    else{
        //highest power of 2 dividing (k-1)!
        p=0; ll ex=2;
        while (ex<=k-1){
            p+=ll((k-1)/ex); ex*=2;
        }
        //cancel top and bottom by 2^p
        ll e=(n%(M-1))*((k-1)%(M-1)); e%=(M-1);
        e=(e-(p%(M-1))+(M-1))%(M-1);
        //cout<<e<<' '<<p<<endl;
        ll a=1,b=power(2,e);
        if (k<M){
            ll tot=power(2,n);
            for (ll i=1;i<=k-1;i++) a=(a*(tot-i))%M;
            //divide by 2^p, i.e. multiply by inv^p
            a=(a*power(inv,p))%M;
        }
        else a=0;
        cout<<(b-a+M)%M<<' '<<b<<endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint CountResiduals(llint lo, llint hi, llint mod, llint adder, vector<llint> *p_counts) {
  auto &counts = *p_counts;
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  vector<llint> resid_counts(kMod, 0);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder, &resid_counts);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

#include <cstdlib>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  exit(0);
  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

#include <cstdlib>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  quick_exit(0);
  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

#include <cstdlib>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;

  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  // llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    // llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * (CountTo(shifted_hi, 2, 1) - CountTo(shifted_lo - 1, 2, 1));
    }
  }

  llint numer;
  if (k > kMod) {
    numer = 0;
  } else {
    numer = 1;
    llint two_to_n = PowMod(2, n, kMod);
    for (llint i = 1; i <= k-1; ++i) {
      numer = numer * (two_to_n + kMod - i) % kMod;
    }
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;
  numer = numer * cancel % kMod;
  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

#include <cstdlib>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;

  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  // llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    // llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * (CountTo(shifted_hi, 2, 1) - CountTo(shifted_lo - 1, 2, 1));
    }
  }

  llint numer;
  if (k > kMod) {
    numer = 0;
  } else {
    numer = 1;
    llint two_to_n = PowMod(2, n, kMod);
    for (llint i = 1; i <= k-1; ++i) {
      numer = numer * (two_to_n + kMod - i) % kMod;
    }
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountResiduals(llint lo, llint hi, llint mod, vector<llint> *p_counts) {
  auto &counts = *p_counts;
  llint m = min(hi, lo + mod - 1);
  llint counted = 0;
  for (llint i = lo; i <= m; ++i) {
    if (i % 2 == 1) {
      llint delta = (hi - i) / (2 * mod) + 1;
      counts[i % mod] += delta;
      counted += delta;
    }
  }
  return counted;
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  vector<llint> resid_counts(kMod, 0);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo + adder, shifted_hi + adder, kMod, &resid_counts);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

#define forn(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()

using namespace std;

using llint = long long;
const llint kMaxWorkingBits = 61;
const llint kMod = 1e6 + 3;

llint PowMod(llint x, llint pow, llint mod) {
  llint res = 1;
  llint x_in_pow = x;
  while (pow > 0) {
    if (pow % 2 == 1) {
      res = res * x_in_pow % mod;
    }
    x_in_pow = x_in_pow * x_in_pow % mod;
    pow /= 2;
  }
  return res;
}

llint InvMod(llint x, llint mod) {
  return PowMod(x, mod - 2, mod);
}

llint CountTo(llint hi, llint divisor, llint first_good) {
  if (first_good > hi) {
    return 0;
  }
  return (hi - first_good) / divisor + 1;
}

llint resid_counts[kMod];

llint CountResiduals(llint lo, llint hi, llint mod, llint adder) {
  llint counted = 0;
  for (llint r = 0; r < mod; ++r) {
    llint delta = 0;
    if (r % 2 == 1) {
      delta = CountTo(hi, 2 * mod, r) - CountTo(lo - 1, 2 * mod, r);
    } else {
      delta = CountTo(hi, 2 *mod, r + mod) - CountTo(lo - 1, 2*mod, r + mod);
    }
    resid_counts[(r + adder) % mod] += delta;
    counted += delta;
  }
  return counted;
}

#include <cstdlib>

int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);

  llint n, k;
  cin >> n >> k;
  if (n <= kMaxWorkingBits && (1LL << n) < k) {
    cout << "1 1" << endl;
    return 0;
  }

  llint working_bits = min(kMaxWorkingBits, n);
  llint adder = (PowMod(2, n - working_bits, kMod) - 1) * (2LL << working_bits) % kMod;

  llint working_range_lo = (1LL << working_bits) - k + 1;
  llint working_range_hi = (1LL << working_bits) - 1;

  llint cancel_power = 0;
  for (int s = 0; s <= working_bits; ++s) {
    llint pat = (1LL << s) - 1;
    llint shifted_lo = (working_range_lo + pat) >> s;
    llint shifted_hi = (working_range_hi) >> s;
    llint counted = CountResiduals(shifted_lo, shifted_hi, kMod, adder);
    if (s > 0) {
      cancel_power += s * counted;
    }
  }

  llint numer = 1;
  forn(r, kMod) {
    numer = numer * PowMod(r, resid_counts[r], kMod) % kMod;
  }

  llint denom = PowMod(PowMod(2, n, kMod), k - 1, kMod) % kMod;
  llint cancel = InvMod(PowMod(2, cancel_power, kMod), kMod);
  denom = denom * cancel % kMod;

  cout << (kMod + denom - numer) % kMod << ' ' << denom << endl;
  return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define maxn 200001
typedef long long LL;
const LL mod=1e6+3;
LL get(LL x,LL y)
{
    LL ans=1;
    while(y)
    {
        if(y%2)
        {
            ans*=x;
            ans%=mod;
        }
        x*=x;
        x%=mod;
        y>>=1LL;
    }
    return ans%mod;
}
LL gcd(LL a,LL b)
{
    return b==0?a:gcd(b,a%b);
}
int main()
{
    LL n,k,i;
    scanf("%I64d%I64d",&n,&k);
    LL B=get(get(2,n),k);
    if(k>=mod)
    {
        puts("1 1");return 0;
    }
    LL A=1;
    for(i=0;i<k;i++)
    {
        A*=(get(2,n)-i);
        A%=mod;
    }
    A=B-A;
    LL temp=gcd(A,B);
    printf("%I64d %I64d\n",A/temp%mod,B/temp%mod);

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define maxn 200001
typedef long long LL;
const LL mod=1e6+3;
LL get(LL x,LL y)
{
    LL ans=1;
    while(y)
    {
        if(y%2)
        {
            ans*=x;
            ans%=mod;
        }
        x*=x;
        x%=mod;
        y>>=1LL;
    }
    return ans%mod;
}
int main()
{
    LL n,k,i;
    scanf("%I64d%I64d",&n,&k);
    if(n<=63&&(1LL<<n)<k)
    {
        puts("1 1");return 0;
    }
    LL B=get(get(2,n),k-1);
    LL A;
    LL num=0;

        A=1LL;
        LL temp=get(2,n);
        for(i=1;i<k;i++)
        {
            A*=(temp-i);
            A%=mod;
            if(A==0)break;
        }
    for(i=1;i<k;i<<=1LL)
        num+=i/2;
    A=A*get(get(2,mod-2),num)%mod;
    B=B*get(get(2,mod-2),num)%mod;
   A=B-A;
   if(A<0)A=(A+mod)%mod;
    printf("%I64d %I64d\n",A%mod,B%mod);

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define maxn 200001
typedef long long LL;
const LL mod=1e6+3;
LL get(LL x,LL y)
{
    LL ans=1;
    while(y)
    {
        if(y%2)
        {
            ans*=x;
            ans%=mod;
        }
        x*=x;
        x%=mod;
        y>>=1LL;
    }
    return ans%mod;
}
int main()
{
    LL n,k,i;
    scanf("%I64d%I64d",&n,&k);
    LL B=get(get(2,n),k-1);
    LL A;
    LL num=0;

        A=1LL;
        LL temp=get(2,n);
        for(i=1;i<k;i++)
        {
            A*=(temp-i);
            A%=mod;
            if(A==0)break;
        }
    for(i=2;i<k;i<<=1LL)
        num+=i/2;
    A=A*get(get(2,mod-2),num)%mod;
    B=B*get(get(2,mod-2),num)%mod;
   A=B-A;
   if(A<0)A=(A+mod)%mod;
    printf("%I64d %I64d\n",A%mod,B%mod);

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define maxn 200001
typedef long long LL;
const LL mod=1e6+3;
LL get(LL x,LL y)
{
    LL ans=1;
    while(y)
    {
        if(y%2)
        {
            ans*=x;
            ans%=mod;
        }
        x*=x;
        x%=mod;
        y>>=1LL;
    }
    return ans%mod;
}
int main()
{
    LL n,k,i;
    scanf("%I64d%I64d",&n,&k);
    if((1LL<<n)<k)
    {
        puts("1 1");return 0;
    }
    LL B=get(get(2,n),k-1);
    LL A;
    LL num=0;

        A=1LL;
        LL temp=get(2,n);
        for(i=1;i<k;i++)
        {
            A*=(temp-i);
            A%=mod;
            if(A==0)break;
        }
    for(i=2;i<k;i<<=1LL)
        num+=i/2;
    A=A*get(get(2,mod-2),num)%mod;
    B=B*get(get(2,mod-2),num)%mod;
   A=B-A;
   if(A<0)A=(A+mod)%mod;
    printf("%I64d %I64d\n",A%mod,B%mod);

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define maxn 200001
typedef long long LL;
const LL mod=1e6+3;
LL get(LL x,LL y)
{
    LL ans=1;
    while(y)
    {
        if(y%2)
        {
            ans*=x;
            ans%=mod;
        }
        x*=x;
        x%=mod;
        y>>=1LL;
    }
    return ans%mod;
}
int main()
{
    LL n,k,i;
    scanf("%I64d%I64d",&n,&k);
    if(n<=63&&(1LL<<n)<k)
    {
        puts("1 1");return 0;
    }
     LL num=0;
     for(i=k-1;i;i>>=1LL)
        num+=i/2;
    LL A;

        A=1LL;
        LL temp=get(2,n);
        for(i=1;i<k;i++)
        {
            A*=(--temp);
            A%=mod;
            if(A==0)break;
        }
    LL B=get(get(2,n),k-1);
    A=A*get(get(2,mod-2),num)%mod;
    B=B*get(get(2,mod-2),num)%mod;
   A=B-A;
   if(A<0)A=(A+mod)%mod;
    printf("%I64d %I64d\n",A%mod,B%mod);

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#define zero(x) (((x)>0?(x):-(x))<eps)

#define pause cout << " press ansy key to continue...",  cin >> chh
#define file_r(x) freopen(x,  "r",  stdin)
#define file_w(x) freopen(x,  "w",  stdout)
#define lowbit(x) ((x) & (-x))
#define repit(i, c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repe(i, u) for (int i = head[u]; i != -1; i = nxt[i])
#define repd(i, n) for (int i = (n - 1); i >= 0; i--)
#define FOR(i, n, m) for (int i = (n); i <= (m); i++)
#define FORD(i, n, m) for (int i = (n); i >= (m); i--)
#define pb push_back
#define X first
#define Y second
#define ins insert
#define rb rbegin
#define be begin
#define er erase
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define SZ(c) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define sqr(r) ((r) * (r))
#define dis(x1, y1, x2, y2) (((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
#define FASTIO ios::sync_with_stdio(false);cin.tie(0)

#define sc(x) cout << #x" = " << x << endl, system("pause")
#define sc2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl, system("pause")
#define sc3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl, system("pause")
#define sc4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl, system("pause")

#define in(n) scanf("%d", &n)
#define in2(n, m) scanf("%d %d", &n, &m)
#define in3(x, y, z) scanf("%d %d %d", &x, &y, &z)

using namespace std;
int chh;

typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<int, pii> pi3;
typedef vector< pair<int, int> > vpii;
typedef long long LL;

const LL MOD = 1000003;

LL n, m;

LL power(LL x, LL y) {
    LL ans = 1;
    while (y) {
        if (y & 1) ans = (LL) ans * x % MOD;
        x = (LL) x * x % MOD;
        y >>= 1;
    }
    return ans;
}

LL cal2() {
    LL t = 1, ans = 0;
    FOR (i, 1, n) {
        t <<= 1LL;
        if (t <= m) ans += ceil(m * 1.0 / t);
        else {
            ans += n - i + 1;
            return ans;
        }
    }
    return ans;
}

int main() {
    LL p, q, d, t;
    while (cin >> n >> m) {
        if (n <= 60 && ((1LL << n) <= m)) {
            puts("1 1");
            continue;
        }
        d = cal2();
        //sc(d);
        q = power(2, m);
        q = power(q, n);
        //sc(q);
        t = power(2, d);
        t = power(t, MOD - 2);
        q = q * t % MOD;
        //sc(q);
        if (m >= MOD) p = 0;
        else {
            d = power(2, n), p = 1;
            rep (i, m) p = p * (d--) % MOD;
            p = p * t % MOD;
        }
        p = (q - p + MOD) % MOD;
        cout << p << ' ' << q << '\n';
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#define zero(x) (((x)>0?(x):-(x))<eps)

#define pause cout << " press ansy key to continue...",  cin >> chh
#define file_r(x) freopen(x,  "r",  stdin)
#define file_w(x) freopen(x,  "w",  stdout)
#define lowbit(x) ((x) & (-x))
#define repit(i, c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repe(i, u) for (int i = head[u]; i != -1; i = nxt[i])
#define repd(i, n) for (int i = (n - 1); i >= 0; i--)
#define FOR(i, n, m) for (int i = (n); i <= (m); i++)
#define FORD(i, n, m) for (int i = (n); i >= (m); i--)
#define pb push_back
#define X first
#define Y second
#define ins insert
#define rb rbegin
#define be begin
#define er erase
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define SZ(c) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define sqr(r) ((r) * (r))
#define dis(x1, y1, x2, y2) (((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
#define FASTIO ios::sync_with_stdio(false);cin.tie(0)

#define sc(x) cout << #x" = " << x << endl, system("pause")
#define sc2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl, system("pause")
#define sc3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl, system("pause")
#define sc4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl, system("pause")

#define in(n) scanf("%d", &n)
#define in2(n, m) scanf("%d %d", &n, &m)
#define in3(x, y, z) scanf("%d %d %d", &x, &y, &z)

using namespace std;
int chh;

typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<int, pii> pi3;
typedef vector< pair<int, int> > vpii;
typedef long long LL;

const LL MOD = 1000003;

LL n, m;

LL power(LL x, LL y) {
    LL ans = 1;
    while (y) {
        if (y & 1) ans = (LL) ans * x % MOD;
        x = (LL) x * x % MOD;
        y >>= 1;
    }
    return ans;
}

LL cal2() {
    LL t = 1, ans = 0;
    FOR (i, 1, n) {
        t <<= 1LL;
        if (t <= m) ans += m / t + (m % t ? 1 : 0);
        else {
            ans += n - i + 1;
            return ans;
        }
    }
    return ans;
}

int main() {
    LL p, q, d, t;
    while (cin >> n >> m) {
        if (n <= 60 && ((1LL << n) < m)) {
            puts("1 1");
            continue;
        }
        d = cal2();
        //sc(d);
        q = power(2, m);
        q = power(q, n);
        //sc(q);
        t = power(2, d);
        t = power(t, MOD - 2);
        //sc3(q, t, d);
        q = q * t % MOD;
        //sc(q);
        if (m >= MOD) p = 0;
        else {
            d = power(2, n), p = 1;
            rep (i, m) p = p * (d--) % MOD;
            p = p * t % MOD;
        }
        p = (q - p + MOD) % MOD;
        cout << p << ' ' << q << '\n';
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#define zero(x) (((x)>0?(x):-(x))<eps)

#define pause cout << " press ansy key to continue...",  cin >> chh
#define file_r(x) freopen(x,  "r",  stdin)
#define file_w(x) freopen(x,  "w",  stdout)
#define lowbit(x) ((x) & (-x))
#define repit(i, c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repe(i, u) for (int i = head[u]; i != -1; i = nxt[i])
#define repd(i, n) for (int i = (n - 1); i >= 0; i--)
#define FOR(i, n, m) for (int i = (n); i <= (m); i++)
#define FORD(i, n, m) for (int i = (n); i >= (m); i--)
#define pb push_back
#define X first
#define Y second
#define ins insert
#define rb rbegin
#define be begin
#define er erase
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define SZ(c) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define sqr(r) ((r) * (r))
#define dis(x1, y1, x2, y2) (((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
#define FASTIO ios::sync_with_stdio(false);cin.tie(0)

#define sc(x) cout << #x" = " << x << endl, system("pause")
#define sc2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl, system("pause")
#define sc3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl, system("pause")
#define sc4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl, system("pause")

#define in(n) scanf("%d", &n)
#define in2(n, m) scanf("%d %d", &n, &m)
#define in3(x, y, z) scanf("%d %d %d", &x, &y, &z)

using namespace std;
int chh;

typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<int, pii> pi3;
typedef vector< pair<int, int> > vpii;
typedef long long LL;

const LL MOD = 1000003;

LL n, m;

LL power(LL x, LL y) {
    LL ans = 1;
    while (y) {
        if (y & 1) ans = (LL) ans * x % MOD;
        x = (LL) x * x % MOD;
        y >>= 1;
    }
    return ans;
}

LL cal2() {
    LL t = 1, ans = 0;
    FOR (i, 1, n) {
        t <<= 1LL;
        if (t <= m) ans += ceil(m * 1.0 / t);
        else {
            ans += n - i + 1;
            return ans;
        }
    }
    return ans;
}

int main() {
    LL p, q, d, t;
    while (cin >> n >> m) {
        if (n <= 60 && ((1LL << n) < m)) {
            puts("1 1");
            continue;
        }
        d = cal2();
        //sc(d);
        q = power(2, m);
        q = power(q, n);
        //sc(q);
        t = power(2, d);
        t = power(t, MOD - 2);
        q = q * t % MOD;
        //sc(q);
        if (m >= MOD) p = 0;
        else {
            d = power(2, n), p = 1;
            rep (i, m) p = p * (d--) % MOD;
            p = p * t % MOD;
        }
        p = (q - p + MOD) % MOD;
        cout << p << ' ' << q << '\n';
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#define zero(x) (((x)>0?(x):-(x))<eps)

#define pause cout << " press ansy key to continue...",  cin >> chh
#define file_r(x) freopen(x,  "r",  stdin)
#define file_w(x) freopen(x,  "w",  stdout)
#define lowbit(x) ((x) & (-x))
#define repit(i, c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repe(i, u) for (int i = head[u]; i != -1; i = nxt[i])
#define repd(i, n) for (int i = (n - 1); i >= 0; i--)
#define FOR(i, n, m) for (int i = (n); i <= (m); i++)
#define FORD(i, n, m) for (int i = (n); i >= (m); i--)
#define pb push_back
#define X first
#define Y second
#define ins insert
#define rb rbegin
#define be begin
#define er erase
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define SZ(c) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define sqr(r) ((r) * (r))
#define dis(x1, y1, x2, y2) (((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
#define FASTIO ios::sync_with_stdio(false);cin.tie(0)

#define sc(x) cout << #x" = " << x << endl, system("pause")
#define sc2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl, system("pause")
#define sc3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl, system("pause")
#define sc4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl, system("pause")

#define in(n) scanf("%d", &n)
#define in2(n, m) scanf("%d %d", &n, &m)
#define in3(x, y, z) scanf("%d %d %d", &x, &y, &z)

using namespace std;
int chh;

typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<int, pii> pi3;
typedef vector< pair<int, int> > vpii;
typedef long long LL;

const LL MOD = 1000003;

LL n, m;

LL power(LL x, LL y) {
    LL ans = 1;
    while (y) {
        if (y & 1) ans = (LL) ans * x % MOD;
        x = (LL) x * x % MOD;
        y >>= 1;
    }
    return ans;
}

LL cal2() {
    LL t = 1, ans = 0;
    FOR (i, 1, n) {
        t <<= 1LL;
        if (t <= m) ans += ceil(m * 1.0 / t);
        else {
            ans += n - i + 1;
            return ans;
        }
    }
    return ans;
}

int main() {
    LL p, q, d, t;
    while (cin >> n >> m) {
        if (n <= 60 && ((1LL << n) <= m)) {
            puts("1 1");
            continue;
        }
        d = cal2();
        sc(d);
        q = power(2, m);
        q = power(q, n);
        sc(q);
        t = power(2, d);
        t = power(t, MOD - 2);
        q = q * t % MOD;
        sc(q);
        if (m >= MOD) p = 0;
        else {
            d = power(2, n), p = 1;
            rep (i, m) p = p * (d--) % MOD;
            p = p * t % MOD;
        }
        p = (q - p + MOD) % MOD;
        cout << p << ' ' << q << '\n';
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <cfloat>
#define zero(x) (((x)>0?(x):-(x))<eps)

#define pause cout << " press ansy key to continue...",  cin >> chh
#define file_r(x) freopen(x,  "r",  stdin)
#define file_w(x) freopen(x,  "w",  stdout)
#define lowbit(x) ((x) & (-x))
#define repit(i, c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repe(i, u) for (int i = head[u]; i != -1; i = nxt[i])
#define repd(i, n) for (int i = (n - 1); i >= 0; i--)
#define FOR(i, n, m) for (int i = (n); i <= (m); i++)
#define FORD(i, n, m) for (int i = (n); i >= (m); i--)
#define pb push_back
#define X first
#define Y second
#define ins insert
#define rb rbegin
#define be begin
#define er erase
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define SZ(c) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define sqr(r) ((r) * (r))
#define dis(x1, y1, x2, y2) (((x1) - (x2)) * ((x1) - (x2)) + ((y1) - (y2)) * ((y1) - (y2)))
#define FASTIO ios::sync_with_stdio(false);cin.tie(0)

#define sc(x) cout << #x" = " << x << endl, system("pause")
#define sc2(x, y) cout << #x" = " << x << " " << #y" = " << y << endl, system("pause")
#define sc3(x, y, z) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << endl, system("pause")
#define sc4(x, y, z, w) cout << #x" = " << x << " " << #y" = " << y << " " << #z" = " << z << " " << #w" = " << w << endl, system("pause")

#define in(n) scanf("%d", &n)
#define in2(n, m) scanf("%d %d", &n, &m)
#define in3(x, y, z) scanf("%d %d %d", &x, &y, &z)

using namespace std;
int chh;

typedef vector<int> vi;
typedef set<int> si;
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<int, pii> pi3;
typedef vector< pair<int, int> > vpii;
typedef long long LL;

const LL MOD = 1000003;

LL n, m;

LL power(LL x, LL y) {
    LL ans = 1;
    while (y) {
        if (y & 1) ans = (LL) ans * x % MOD;
        x = (LL) x * x % MOD;
        y >>= 1;
    }
    return ans;
}

LL cal2() {
    LL t = 1, ans = 0;
    FOR (i, 1, n) {
        t <<= 1LL;
        if (t <= m) ans += ceil(m * 1.0 / t);
        else {
            ans += n - i + 1;
            return ans;
        }
    }
    return ans;
}

int main() {
    LL p, q, d, t;
    while (cin >> n >> m) {
        if (n <= 60 && ((1LL << n) <= m)) {
            puts("1 1");
            continue;
        }
        d = cal2();
        q = power(2, m);
        q = power(q, n);
        t = power(2, d);
        t = power(t, MOD - 2);
        q = q * t % MOD;
        if (m >= MOD) p = 0;
        else {
            d = power(2, n), p = 1;
            rep (i, m) p = p * (d--) % MOD;
            p = p * t % MOD;
            p = (q - p + MOD) % MOD;
        }
        cout << p << ' ' << q << '\n';
    }
    return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % MOD;
    t = t * t % MOD;
    p>>=1;
  }
  return ret;
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n >= 60) {
    puts("0 1");
    return 0;
  }
  if (k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if ((1ll<<n) - k > MOD) {
    puts("0 1");
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = (1<<n)-k+1; i <= (1ll<<n); i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * j % MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  b = fPow(fPow(2, n), k) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % MOD;
    t = t * t % MOD;
    p>>=1;
  }
  return ret;
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n >= 60) {
    puts("1 1");
    return 0;
  }
  if (k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if ((1ll<<n) - k > MOD) {
    puts("1 1");
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = (1<<n)-k+1; i <= (1ll<<n); i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * j % MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  if (n <= tot2 && k <= tot2 && n * k <= tot2) {
    b = b * fPow(2, n * k - tot2) % MOD;
    a = a * fPow(2, n * k - tot2) % MOD;
  }
  b = fPow(fPow(2, n), k) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % MOD;
    t = t * t % MOD;
    p>>=1;
  }
  return ret;
}

LL twos(LL x) {
  return x/2 + twos(x/2);
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n <= 60 && k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if (n > 60 || (1ll<<n) - k > MOD) {
    LL x = fPow(fPow(2, n), k) * fPow(fPow(2, MOD-2), twos(k)) % MOD;
    printf("%I64d %I64d\n", x, x);
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = (1<<n)-k+1; i <= (1ll<<n); i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * j % MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  if (n <= tot2 && k <= tot2 && n * k <= tot2) {
    b = b * fPow(2, n * k - tot2) % MOD;
    a = a * fPow(2, n * k - tot2) % MOD;
  }
  b = fPow(fPow(2, n), k) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % MOD;
    t = t * t % MOD;
    p>>=1;
  }
  return ret;
}

LL twos(LL x) {
  if (x == 0)
    return 0;
  return x/2 + twos(x/2);
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n <= 60 && k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if (n > 60 || (1ll<<n) - k > MOD) {
    LL x = fPow(fPow(2, n), k) * fPow(fPow(2, MOD-2), twos(k)) % MOD;
    printf("%I64d %I64d\n", x, x);
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = (1<<n)-k+1; i <= (1ll<<n); i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * j % MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  if (n <= tot2 && k <= tot2 && n * k <= tot2) {
    b = b * fPow(2, n * k - tot2) % MOD;
    a = a * fPow(2, n * k - tot2) % MOD;
  }
  b = fPow(fPow(2, n), k) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p, LL mod = MOD) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % mod;
    t = t * t % mod;
    p>>=1;
  }
  return ret;
}

LL twos(LL x) {
  if (x == 0)
    return 0;
  return x/2 + twos(x/2);
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n <= 60 && k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if (n > 60 || (1ll<<n) - k > MOD) {
    LL x = fPow(fPow(2, n), k-1) * fPow(fPow(2, MOD-2), twos(k-1)) % MOD;
    printf("%I64d %I64d\n", x, x);
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = (1<<n)-k+1; i <= (1ll<<n); i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * j % MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  if (n <= tot2 && k <= tot2 && n * k <= tot2) {
    b = b * fPow(2, n * k - tot2) % MOD;
    a = a * fPow(2, n * k - tot2) % MOD;
  }
  b = fPow(fPow(2, n), k) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<string>
#include<queue>
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,n) for(int i=1; i<=n; i++)

typedef long long LL;
using namespace std;

typedef pair<int,int> pii;
#define MP make_pair

#define MOD 1000003
LL fPow(LL t, LL p, LL mod = MOD) {
  LL ret = 1;
  while (p) {
    if (p&1)
      ret = ret * t % mod;
    t = t * t % mod;
    p>>=1;
  }
  return ret;
}

LL twos(LL x) {
  if (x == 0)
    return 0;
  return x/2 + twos(x/2);
}
int factor[1000010];
int main(){
#ifdef QWERTIER
  freopen("in.txt","r",stdin);
#endif
  LL n, k;
  scanf("%I64d%I64d", &n, &k);
  if (n <= 60 && k > (1ll<<n)) {
    puts("1 1");
    return 0;
  }
  if (k > MOD) {
    LL x = fPow(fPow(2, n), k-1) * fPow(fPow(2, MOD-2), twos(k-1)) % MOD;
    printf("%I64d %I64d\n", x, x);
    return 0;
  }
  LL a = 1, b = 1;
  int tot2 = 0;
  for (LL i = 1; i <= k-1; i++) {
    //printf("%d\n", i);
    LL j = i;
    while (j % 2 == 0) {
      j /= 2;
      tot2++;
    }
    a = a * (fPow(2, n)-i) % MOD;
    a+=MOD;
    a%=MOD;
    //printf("j:%d %d\n", j, rem2);
  }
  a = a * fPow(fPow(2, MOD - 2), tot2) % MOD;
  b = fPow(fPow(2, n), k-1) * fPow(fPow(2, MOD -2), tot2) % MOD;
  //printf("%I64d %I64d\n", a, b);
  printf("%I64d %I64d\n", ((b - a)%MOD+MOD)%MOD, b);
  return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int mod = 1e6+3;
const double eps = 1e-8;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(LL i = 1; (1LL<<i)<k; i++) cnt += (k-1)/(1LL<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
		if(n < log(1.0*k)/log(2.0)-eps) {printf("1 1\n"); continue;}
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk;
		if(k > mod) kk = mod;
		else kk = k;
		int tt = qpow(2, n);
		for(int i = 0; i < kk; i++){
			fz = fz*(tt-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const LL mod = 1e6+3;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(LL i = 1; (1LL<<i)<k; i++) cnt += (k-1)/(1LL<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
		if(n < (LL)(log(1.0*k)/log(2.0))) {printf("1 1\n"); continue;}
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk = min(k, mod);
		for(int i = 0; i < kk; i++){
			fz = fz*(qpow(2, n)-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int mod = 1e6+3;
const double eps = 1e-9;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(LL i = 1; (1LL<<i)<k; i++) cnt += (k-1)/(1LL<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
        if(n < 60){
            if((LL)pow(2, n) < k) {printf("1 1\n"); continue;}
        }
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk;
		if(k > mod) kk = mod;
		else kk = k;
		int tt = qpow(2, n);
		for(int i = 0; i < kk; i++){
			fz = fz*(tt-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int mod = 1e6+3;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(LL i = 1; (1LL<<i)<k; i++) cnt += (k-1)/(1LL<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
		if(n < (LL)ceil((log(1.0*k)/log(2.0)))) {printf("1 1\n"); continue;}
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk;
		if(k > mod) kk = mod;
		else kk = k;
		int tt = qpow(2, n);
		for(int i = 0; i < kk; i++){
			fz = fz*(tt-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const LL mod = 1e6+3;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(int i = 1; (1<<i)<k; i++) cnt += (k-1)/(1<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
		if(n <= (int)(log(1.0*k)/log(2.0))) {printf("1 1\n"); continue;}
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk = min(k, mod);
		for(int i = 0; i < kk; i++){
			fz = fz*(qpow(2, n)-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int mod = 1e6+3;
const double eps = 1e-9;
LL n, k;
LL qpow(LL a, LL b){
	LL re = 1; a %= mod;
	while(b){
		if(b&1) re = re*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return re;
}

LL gcd(LL a, LL b){
	LL t = 1, cnt = n;
	for(LL i = 1; (1LL<<i)<k; i++) cnt += (k-1)/(1LL<<i);
	return qpow(2, cnt);
}

int main(){
	//freopen("in.txt", "r", stdin);
	while(~scanf("%I64d%I64d", &n, &k)){
		if(n < log(1.0*k)/log(2.0)+eps) {printf("1 1\n"); continue;}
		LL tmp = qpow(2, n);
		tmp = qpow(tmp, k);
		LL g = gcd(n, k);
		LL fz = 1, fm;
		fm = fz;
		int kk;
		if(k > mod) kk = mod;
		else kk = k;
		int tt = qpow(2, n);
		for(int i = 0; i < kk; i++){
			fz = fz*(tt-i+mod)%mod;
		}
		fz = ((-1*fz+tmp)%mod+mod)%mod;
		fz = fz*qpow(g, mod-2)%mod;
		fm = fm*tmp%mod;
		fm = fm*qpow(g, mod-2)%mod;
		printf("%I64d %I64d\n", fz, fm);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>

#define read1(a) int a; scanf("%d", &a)
#define read2(a, b) int a, b; scanf("%I64d %I64d", &a, &b)
#define read3(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c)

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)

#define readgi(n) F0R(i, n) { scanf("%d", &arr[i]); }
#define readgs(n) F0R(i, n) { scanf(" %c", &arr[i]); }

#define f first
#define s second

const int MOD = 1000003;
const int MAX = 1005;

ll mult(ll a, ll b) { return a*b%MOD; }
ll sq(ll a) { return a*a%MOD; }

ll expo(ll a, ll b) {
    if (b == 0) { return 1LL; }
    if (b%2) { return mult(a, sq(expo(a, b/2))); }
    else { return sq(expo(a, b/2)); }
}
ll calc(ll k) {
    ll tot = 0;
    while (k > 0) {
        tot += k/2; k /= 2;
    }
    return tot;
}

int main() {
    ll n, k; cin >> n >> k;
    if (n <= 60 && (1LL<<n)<k) { cout << 1 << " " << 1 << endl; return 0; }
    ll twos = calc(k-1)+n;
    ll denom = expo(expo(2, n%(MOD-1)), k%(MOD-1));
    denom = mult(denom, expo(expo(2, MOD-2), twos%(MOD-1)));
    ll top = 1;
    ll exp2n = expo(2, n);

    for (int i=0; i<=min(1000003LL, k-1); i++) { top = mult(top, exp2n-i); }
    ll num = (denom - mult(top, expo(expo(2, MOD-2), twos%(MOD-1))));
    cout << num << " " << denom << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>

#define read1(a) int a; scanf("%d", &a)
#define read2(a, b) int a, b; scanf("%I64d %I64d", &a, &b)
#define read3(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c)

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)

#define readgi(n) F0R(i, n) { scanf("%d", &arr[i]); }
#define readgs(n) F0R(i, n) { scanf(" %c", &arr[i]); }

#define f first
#define s second

const int MOD = 1000003;
const int MAX = 1005;

ll mult(ll a, ll b) { return a*b%MOD; }
ll sq(ll a) { return a*a%MOD; }

ll expo(ll a, ll b) {
    if (b == 0) { return 1LL; }
    if (b%2) { return mult(a, sq(expo(a, b/2))); }
    else { return sq(expo(a, b/2)); }
}
ll calc(ll k) {
    ll tot = 0;
    while (k > 0) {
        tot += k/2; k /= 2;
    }
    return tot;
}

int main() {
    ll n, k; cin >> n >> k;
    if (n <= 60 && (1<<n)<k) { cout << 1 << " " << 1 << endl; return 0; }
    ll twos = calc(k-1)+n;
    ll denom = expo(expo(2, n%(MOD-1)), k%(MOD-1));
    denom = mult(denom, expo(expo(2, MOD-2), twos%(MOD-1)));
    ll top = 1;
    ll exp2n = expo(2, n);

    for (int i=0; i<=min(1000003LL, k-1); i++) { top = mult(top, exp2n-i); }
    ll num = (denom - mult(top, expo(expo(2, MOD-2), twos%(MOD-1))));
    cout << num << " " << denom << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>

#define read1(a) int a; scanf("%d", &a)
#define read2(a, b) int a, b; scanf("%I64d %I64d", &a, &b)
#define read3(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c)

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)

#define readgi(n) F0R(i, n) { scanf("%d", &arr[i]); }
#define readgs(n) F0R(i, n) { scanf(" %c", &arr[i]); }

#define f first
#define s second

const int MOD = 1000003;
const int MAX = 1005;

ll mult(ll a, ll b) { return a*b%MOD; }
ll sq(ll a) { return a*a%MOD; }

ll expo(ll a, ll b) {
    if (b == 0) { return 1LL; }
    if (b%2) { return mult(a, sq(expo(a, b/2))); }
    else { return sq(expo(a, b/2)); }
}
ll calc(ll k) {
    ll tot = 0;
    while (k > 0) {
        tot += k/2; k /= 2;
    }
    return tot;
}

int main() {
    ll n, k; cin >> n >> k;
    if (n <= 60 && (1<<n)<k) { cout << 1 << " " << 1 << endl; return 0; }
    ll twos = calc(k-1)+n;
    ll denom = expo(expo(2, n%(MOD-1)), k%(MOD-1));
    denom = mult(denom, expo(expo(2, MOD-2), twos%(MOD-1)));
    ll top = 1;
    ll exp2n = expo(2, n);
    for (int i=0; i<=(k-1); i++) { top = mult(top, exp2n-i); }
    ll num = (denom - mult(top, expo(expo(2, MOD-2), twos%(MOD-1))));
    cout << num << " " << denom << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>

#define read1(a) int a; scanf("%d", &a)
#define read2(a, b) int a, b; scanf("%I64d %I64d", &a, &b)
#define read3(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c)

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)

#define readgi(n) F0R(i, n) { scanf("%d", &arr[i]); }
#define readgs(n) F0R(i, n) { scanf(" %c", &arr[i]); }

#define f first
#define s second

const int MOD = 1000003;
const int MAX = 1005;

ll mult(ll a, ll b) { return a*b%MOD; }
ll sq(ll a) { return a*a%MOD; }

ll expo(ll a, ll b) {
    if (b == 0) { return 1LL; }
    if (b%2) { return mult(a, sq(expo(a, b/2))); }
    else { return sq(expo(a, b/2)); }
}
ll calc(ll k) {
    ll tot = 0;
    while (k > 0) {
        tot += k/2; k /= 2;
    }
    return tot;
}

int main() {
    ll n, k; cin >> n >> k;
    if (n <= 60 && (1LL<<n)<k) { cout << 1 << " " << 1 << endl; return 0; }
    ll twos = calc(k-1)+n;
    ll denom = expo(expo(2, n%(MOD-1)), k%(MOD-1));
    denom = mult(denom, expo(expo(2, MOD-2), twos%(MOD-1)));
    ll top = 1;
    ll exp2n = expo(2, n);

    for (int i=0; i<=min(1000003LL, k-1); i++) { top = mult(top, exp2n-i+MOD); }
    ll num = (denom - mult(top, expo(expo(2, MOD-2), twos%(MOD-1))));
    cout << (num%MOD+MOD)%MOD << " " << denom << endl;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair <int, int>
#define vi vector<int>

#define read1(a) int a; scanf("%d", &a)
#define read2(a, b) int a, b; scanf("%I64d %I64d", &a, &b)
#define read3(a, b, c) int a, b, c; scanf("%d %d %d", &a, &b, &c)

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)

#define readgi(n) F0R(i, n) { scanf("%d", &arr[i]); }
#define readgs(n) F0R(i, n) { scanf(" %c", &arr[i]); }

#define f first
#define s second

const int MOD = 1000003;
const int MAX = 1005;

ll mult(ll a, ll b) { return a*b%MOD; }
ll sq(ll a) { return a*a%MOD; }

ll expo(ll a, ll b) {
    if (b == 0) { return 1LL; }
    if (b%2) { return mult(a, sq(expo(a, b/2))); }
    else { return sq(expo(a, b/2)); }
}
ll calc(ll k) {
    ll tot = 0;
    while (k > 0) {
        tot += k/2; k /= 2;
    }
    return tot;
}

int main() {
    ll n, k; cin >> n >> k;
    if (n <= 60 && (1LL<<n)<k) { cout << 1 << " " << 1 << endl; return 0; }
    ll twos = calc(k-1)+n;
    ll denom = expo(expo(2, n%(MOD-1)), k%(MOD-1));
    denom = mult(denom, expo(expo(2, MOD-2), twos%(MOD-1)));
    ll top = 1;
    ll exp2n = expo(2, n);

    for (int i=0; i<=min(1000003LL, k-1); i++) { top = mult(top, exp2n-i+MOD); }
    ll num = (denom - mult(top, expo(expo(2, MOD-2), twos%(MOD-1))));
    cout << num << " " << denom << endl;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <set>
#include <queue>
#include <cmath>

#define rep(i,l,r) for (int i=l;i<=r;++i)
#define REP(i,r,l) for (int i=r;i>=l;--i)
#define st first
#define nd second
using namespace std;

typedef long long LL;

const LL MD=1E6+3;
const LL REV=(MD+1)/2;
LL n,m,a,b;

LL pwr(LL a,LL b){
	LL c=1;
	while (b) {
		if (b&1) (c*=a)%=MD;
		(a*=a)%=MD; b/=2;
	}
	return c;
}

int main(){
	scanf("%lld%lld",&n,&m);
	if (log(m)/log(2) >= n) {printf("1 1\n"); return 0;}
	b=pwr(2,(n%(MD-1))*((m-1)%(MD-1))%(MD-1));
	LL mt=pwr(2,n);
	if (m<MD+1) {
		a=1;
		rep(i,1,m-1) (a*=LL(mt-i))%=MD;
		}
		else a=0;
	LL i=2;
	while (i<=m-1) {LL t=pwr(REV,(m-1)/i); (b*=t)%=MD; (a*=t)%=MD; i*=2;}
	a=(b-a+MD)%MD;
	printf("%lld %lld\n",a,b);
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <set>
#include <queue>
#include <cmath>

#define rep(i,l,r) for (int i=l;i<=r;++i)
#define REP(i,r,l) for (int i=r;i>=l;--i)
#define st first
#define nd second
using namespace std;

typedef long long LL;

const LL MD=1E6+3;
const LL REV=(MD+1)/2;
LL n,m,a,b;

LL pwr(LL a,LL b){
	LL c=1;
	while (b) {
		if (b&1) (c*=a)%=MD;
		(a*=a)%=MD; b/=2;
	}
	return c;
}

int main(){
	scanf("%lld%lld",&n,&m);
	LL kth[63]={1};
	rep(i,1,62) kth[i]=kth[i-1]*2;
	if (n<63 && kth[n]<m) {printf("1 1\n"); return 0;}
	b=pwr(2,(n%(MD-1))*((m-1)%(MD-1))%(MD-1));
	LL mt=pwr(2,n);
	if (m<MD+1) {
		a=1;
		rep(i,1,m-1) (a*=LL(mt-i))%=MD;
		}
		else a=0;
	LL i=2;
	while (i<=m-1) {LL t=pwr(REV,(m-1)/i); (b*=t)%=MD; (a*=t)%=MD; i*=2;}
	a=(b-a+MD)%MD;
	printf("%lld %lld\n",a,b);
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <set>
#include <queue>
#include <cmath>

#define rep(i,l,r) for (int i=l;i<=r;++i)
#define REP(i,r,l) for (int i=r;i>=l;--i)
#define st first
#define nd second
using namespace std;

typedef long long LL;

const LL MD=1E6+3;
const LL REV=(MD+1)/2;
LL n,m,a,b;

LL pwr(LL a,LL b){
	LL c=1;
	while (b) {
		if (b&1) (c*=a)%=MD;
		(a*=a)%=MD; b/=2;
	}
	return c;
}

int main(){
	scanf("%lld%lld",&n,&m);
	if (log(m)/log(2) > n) {printf("1 1\n"); return 0;}
	b=pwr(2,(n%(MD-1))*((m-1)%(MD-1))%(MD-1));
	LL mt=pwr(2,n);
	if (m<MD+1) {
		a=1;
		rep(i,1,m-1) (a*=LL(mt-i))%=MD;
		}
		else a=0;
	LL i=2;
	while (i<=m-1) {LL t=pwr(REV,(m-1)/i); (b*=t)%=MD; (a*=t)%=MD; i*=2;}
	a=(b-a+MD)%MD;
	printf("%lld %lld\n",a,b);
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <set>
#include <queue>
#include <cmath>

#define rep(i,l,r) for (int i=l;i<=r;++i)
#define REP(i,r,l) for (int i=r;i>=l;--i)
#define st first
#define nd second
using namespace std;

typedef long long LL;

const LL MD=1E6+3;
const LL REV=(MD+1)/2;
LL n,m,a,b;

LL pwr(LL a,LL b){
	LL c=1;
	while (b) {
		if (b&1) (c*=a)%=MD;
		(a*=a)%=MD; b>>=1;
	}
	return c;
}

int main(){
	scanf("%lld%lld",&n,&m);
	if (log(m)/log(2) >= n) {printf("1 1\n"); return 0;}
	b=pwr(2,n*(m-1)%(MD-1));
	LL mt=pwr(2,n);
	if (m>=MD+1) {printf("1 1\n"); return 0;}
	a=1;
	rep(i,1,m-1) (a*=LL(mt-i))%=MD;
	LL i=2;
	while (i<=m-1) {LL t=pwr(REV,(m-1)/i); (b*=t)%=MD; (a*=t)%=MD; i<<=1;}
	a=(b-a+MD)%MD;
	printf("%lld %lld\n",a,b);
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <set>
#include <queue>
#include <cmath>

#define rep(i,l,r) for (int i=l;i<=r;++i)
#define REP(i,r,l) for (int i=r;i>=l;--i)
#define st first
#define nd second
using namespace std;

typedef long long LL;

const LL MD=1E6+3;
const LL REV=(MD+1)/2;
LL n,m,a,b;

LL pwr(LL a,LL b){
	LL c=1;
	while (b) {
		if (b&1) (c*=a)%=MD;
		(a*=a)%=MD; b/=2;
	}
	return c;
}

int main(){
	scanf("%lld%lld",&n,&m);
	if (log(m)/log(2) >= n) {printf("1 1\n"); return 0;}
	b=pwr(2,n*(m-1)%(MD-1));
	LL mt=pwr(2,n);
	if (m>=MD+1) {printf("1 1\n"); return 0;}
	a=1;
	rep(i,1,m-1) (a*=LL(mt-i))%=MD;
	LL i=2;
	while (i<=m-1) {LL t=pwr(REV,(m-1)/i); (b*=t)%=MD; (a*=t)%=MD; i*=2;}
	a=(b-a+MD)%MD;
	printf("%lld %lld\n",a,b);
}


#include <bits/stdc++.h>

#define MOD (1000003)

using namespace std;

long long exp(long long n, long long e){
	long long ans = 1;
	while(e){
		if(e & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		e >>= 1;
	}
	return ans;
}

long long legendre(long long n){
    long long ans = 0;
    for(int i = 0; i < 63; i++)
        ans += n / (1LL << i);
    return ans;
}

int main(){
    long long n, k;

    scanf("%lld %lld", &n, &k);
    if(n < 63 && k >= (1LL << n)){
        printf("1 1\n");
        return 0;
    }

    long long gcd = exp(2, legendre(k-1));
//     printf("%lld\n", gcd);
    long long a, b;
    long long twoton = exp(2, n);
//     printf("%lld %lld\n", exp(twoton, k-1), (2*exp(gcd, MOD-2) % MOD));
    b = (exp(twoton, k-1) * exp(gcd, MOD-2)) % MOD;

    if(k >= MOD) a = 0;
    else{
        a = 1;
        for(int i = 1; i < k; i++){
            a = (a * (twoton + MOD - i)) % MOD;
//             printf(".%lld\n", a);
        }
        a = (a * exp(gcd, MOD-2)) % MOD;
    }
    a = (b - a + MOD) % MOD;

    printf("%lld %lld\n", a, b);

	return 0;
}


#include <bits/stdc++.h>

#define MOD (1000003)

using namespace std;

long long exp(long long n, long long e){
	long long ans = 1;
	while(e){
		if(e & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		e >>= 1;
	}
	return ans;
}

long long legendre(long long n){
    long long ans = 0;
    for(int i = 0; i < 6; i++)
        ans += n / (1LL << (1LL << i));
    return ans;
}

int main(){
    long long n, k;

    scanf("%lld %lld", &n, &k);
    if(n < 63 && k >= (1LL << n)){
        printf("1 1\n");
        return 0;
    }

    long long gcd = exp(2, legendre(k-1));
//     printf("%lld\n", gcd);
    long long a, b;
    long long twoton = exp(2, n);
//     printf("%lld %lld\n", exp(twoton, k-1), (2*exp(gcd, MOD-2) % MOD));
    b = (exp(twoton, k-1) * exp(gcd, MOD-2)) % MOD;

    if(k >= MOD) a = 0;
    else{
        a = 1;
        for(int i = 1; i < k; i++){
            a = (a * (twoton + MOD - i)) % MOD;
//             printf(".%lld\n", a);
        }
        a = (a * exp(gcd, MOD-2)) % MOD;
    }
    a = (b - a + MOD) % MOD;

    printf("%lld %lld\n", a, b);

	return 0;
}


#include <bits/stdc++.h>

#define MOD (1000003)

using namespace std;

long long exp(long long n, long long e){
	long long ans = 1;
	while(e){
		if(e & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		e >>= 1;
	}
	return ans;
}

long long legendre(long long n, long long p){
    long long ans = 0;
    long long pn = p;
    while(n >= pn){
        ans += n / pn;
        pn *= p;
    }
    return ans;
}

int main(){
    long long n, k;

    scanf("%lld %lld", &n, &k);
    if(n < 63 && k > (1LL << n)){
        printf("1 1\n");
        return 0;
    }

    long long gcd = exp(2, legendre(k-1, 2));
//     printf("%lld\n", gcd);
    long long a, b;
    long long twoton = exp(2, n);
//     printf("%lld %lld\n", exp(twoton, k-1), (2*exp(gcd, MOD-2) % MOD));
    b = (exp(twoton, k-1) * exp(gcd, MOD-2)) % MOD;
    //printf("%lld %lld %lld %lld\n", b, exp(twoton, k-1), exp(2, k-1), exp(exp(2, k-1), n), exp(gcd, MOD-2));

    if(k >= MOD) a = 0;
    else{
        a = 1;
        for(int i = 1; i < k; i++){
            a = (a * (twoton + MOD - i)) % MOD;
//             printf(".%lld\n", a);
        }
        a = (a * exp(gcd, MOD-2)) % MOD;
    }
    a = (b - a + MOD) % MOD;

    printf("%lld %lld\n", a, b);

	return 0;
}


#include <bits/stdc++.h>

#define MOD (1000003)

using namespace std;

long long exp(long long n, long long e){
	long long ans = 1;
	while(e){
		if(e & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		e >>= 1;
	}
	return ans;
}

long long legendre(long long n, long long p){
    long long ans = 0;
    long long pn = p;
    while(n >= pn){
        ans += n / pn;
        pn *= p;
    }
    return ans;
}

int main(){
    long long n, k;

    scanf("%lld %lld", &n, &k);
    if(n < 63 && k >= (1LL << n)){
        printf("1 1\n");
        return 0;
    }

    long long gcd = exp(2, legendre(k-1, 2));
//     printf("%lld\n", gcd);
    long long a, b;
    long long twoton = exp(2, n);
//     printf("%lld %lld\n", exp(twoton, k-1), (2*exp(gcd, MOD-2) % MOD));
    b = (exp(twoton, k-1) * exp(gcd, MOD-2)) % MOD;
    //printf("%lld %lld %lld %lld\n", b, exp(twoton, k-1), exp(2, k-1), exp(exp(2, k-1), n), exp(gcd, MOD-2));

    if(k >= MOD) a = 0;
    else{
        a = 1;
        for(int i = 1; i < k; i++){
            a = (a * (twoton + MOD - i)) % MOD;
//             printf(".%lld\n", a);
        }
        a = (a * exp(gcd, MOD-2)) % MOD;
    }
    a = (b - a + MOD) % MOD;

    printf("%lld %lld\n", a, b);

	return 0;
}


#include <bits/stdc++.h>

#define MOD (1000003)

using namespace std;

long long exp(long long n, long long e){
	long long ans = 1;
	while(e){
		if(e & 1) ans = (ans * n) % MOD;
		n = (n * n) % MOD;
		e >>= 1;
	}
	return ans;
}

long long legendre(long long n, long long p){
    long long ans = 0;
    while(n >= p) ans += n / p, p = p*p;
    return ans;
}

int main(){
    long long n, k;

    scanf("%lld %lld", &n, &k);
    if(n < 63 && k >= (1LL << n)){
        printf("1 1\n");
        return 0;
    }

    long long gcd = exp(2, legendre(k-1, 2));
//     printf("%lld\n", gcd);
    long long a, b;
    long long twoton = exp(2, n);
//     printf("%lld %lld\n", exp(twoton, k-1), (2*exp(gcd, MOD-2) % MOD));
    b = (exp(twoton, k-1) * exp(gcd, MOD-2)) % MOD;

    if(k >= MOD) a = 0;
    else{
        a = 1;
        for(int i = 1; i < k; i++){
            a = (a * (twoton + MOD - i)) % MOD;
//             printf(".%lld\n", a);
        }
        a = (a * exp(gcd, MOD-2)) % MOD;
    }
    a = (b - a + MOD) % MOD;

    printf("%lld %lld\n", a, b);

	return 0;
}


#include <iostream>
#include <cstdio>

using namespace std;

#define For(i , a , b) for (int i = a , _b = b ; i <= _b ; ++i)
#define Ford(i , a  ,b) for (int i = a , _b = b : i >= _b ; --i)
#define Rep(i , n) for (int i = 0 , _n = n ; i < _n ; ++i)
#define sz(A) ((int)A.size())
#define LL(x) (x << 1)
#define RR(x) ((x << 1) | 1)

typedef pair<int , int> pt;

const int md = 1000000 + 3;

long long n , k;

int mul(int a , int b) {
	return 1LL * a * b % md;
}

int pwr(long long a , long long n) {
	a %= md;
	int res = 1;
	while (n) {
		if (n & 1) res = mul(res , a); n >>= 1; a = mul(a , a);
	}
	return res;
}

int Minus(int a , int b) {
	return ((a - b) % md + md) % md;
}

void ReadData() {
	cin >> n >> k;
}

long long cal(int val , long long k) {
	if (val == 0) return k / md;
	if (k % md >= val) return (k / md) + 1;
	return k / md;
}

int mauso() {
	int z = pwr(2 , n); return pwr(z , k - 1);
}

void fail() {
	int x = 0;
	For(i , 0 , 62) {
		if ((1LL << i) >= k) {
			if (i >= n) {
				cout << "1 1" << endl;
				exit(0);
			}
			return;
		}
	}
}

int tuso() {
	int z = pwr(2 , n);
	int res = 1;
	For(i , 0 , md - 1) {
		int need = Minus(z , i);
		//int x = cal(need , k - 1); if (x) cout << need << " " << x << " " << k - 1 << endl;
		res = mul(res , pwr(i , cal(need , k - 1)));
	}
	return Minus(mauso() , res);
}

int z2(long long k) {
	long long cur = 2;
	long long res = 0;
	while (cur <= k) {
		res += k / cur; cur *= 2;
	}
	return res % md;
}

void Process() {
	fail();
	int gcd = pwr(2 , z2( k - 1) );
	int rev = pwr(gcd , md - 2);
	int tu = mul(tuso() , rev);
	int mau = mul(mauso() , rev);

	cout << tu << " " << mau << endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

//	freopen("input.inp" , "r" , stdin);
	ReadData();
	Process();

	return 0;

}


#include <iostream>
#include <cstdio>

using namespace std;

#define For(i , a , b) for (int i = a , _b = b ; i <= _b ; ++i)
#define Ford(i , a  ,b) for (int i = a , _b = b : i >= _b ; --i)
#define Rep(i , n) for (int i = 0 , _n = n ; i < _n ; ++i)
#define sz(A) ((int)A.size())
#define LL(x) (x << 1)
#define RR(x) ((x << 1) | 1)

typedef pair<int , int> pt;

const int md = 1000000 + 3;

long long n , k;

int mul(int a , int b) {
	return 1LL * a * b % md;
}

int pwr(long long a , long long n) {
	a %= md;
	int res = 1;
	while (n) {
		if (n & 1) res = mul(res , a); n >>= 1; a = mul(a , a);
	}
	return res;
}

int Minus(int a , int b) {
	return ((a - b) % md + md) % md;
}

void ReadData() {
	cin >> n >> k;
}

long long cal(int val , long long k) {
	if (val == 0) return k / md;
	if (k % md >= val) return (k / md) + 1;
	return k / md;
}

int mauso() {
	int z = pwr(2 , n); return pwr(z , k - 1);
}

int tuso() {
	int z = pwr(2 , n);
	int res = 1;
	For(i , 0 , md - 1) {
		int need = Minus(z , i);
		//int x = cal(need , k - 1); if (x) cout << need << " " << x << " " << k - 1 << endl;
		res = mul(res , pwr(i , cal(need , k - 1)));
	}
	return Minus(mauso() , res);
}

int z2(long long k) {
	long long cur = 2;
	long long res = 0;
	while (cur <= k) {
		res += k / cur; cur *= 2;
	}
	return res % md;
}

void Process() {
	int gcd = pwr(2 , z2( k - 1) );
	int rev = pwr(gcd , md - 2);
	int tu = mul(tuso() , rev);
	int mau = mul(mauso() , rev);

	cout << tu << " " << mau << endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	//freopen("input.inp" , "r" , stdin);
	ReadData();
	Process();

	return 0;

}