#include<bits/stdc++.h>
using namespace std;
int main(){
    char s,t;
    cin >> s >> t;
    if(s=='Y'){
        t=std::toupper(t);
    }
    cout << t << endl;
}


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

int n, m, ans, MOD;

int mul(int B, int K) {
	int base = B, h = K, res = 1;
	while (h) {
		if (h & 1) res = (res * base) % MOD;
		base = (base * base) % MOD, h >>= 1;
	}
	return res;
}

signed main() {
	// freopen(".in", "r", stdin);
	// freopen(".out", "w", stdout);
	
	cin >> n >> m;
	MOD = m * m, ans = mul(10, n);
	MOD = m, ans = ans - mul(10, n);
	cout << ans / m << endl;
	
	// fclose(stdin);
	// fclose(stdout);
	return 0;
}
