#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cctype>
typedef long long ll;
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar(); bool flag = false;
	while (!isdigit(c)) { if (c == '-') flag = true ;c = getchar(); }
	while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
	if (flag)	x = -x;
}
using namespace std;
ll n, m, mm;
ll P;
inline ll quickpow(ll x, ll k) {
	ll res = 1;
	while (k) {
		if (k & 1)	res = res * x % P;
		x = x * x % P;
		k >>= 1;
	}
	return res;
}
int main() {
	read(n), read(m); mm = 1ll * m * m; P = mm;
	ll ans = quickpow(10, n) / m;
	printf("%lld\n", ans);
	return 0;
}
#include <iostream>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int a, b, c;
	cin >> a >> b;
	
	if (a == b) {
	    c = b;
	} else {
	    c = 3 - a - b;
	}
	
	cout << c << endl;
	
	return 0;
}
