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

// コンテスト中のみ
//#define int long long

#define ll long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define P pair<ll,ll>
#define ld long double
ll INF = (1LL << 60);
int MOD = 1000000007;




signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N; cin >> N;
	if (N == 1) {
		cout << 1051 << endl;
	}
	else if (N == 2)cout << 10275 << endl;
	else cout << 841341 << endl;
	return 0;
}