#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using namespace std;
string S = "1Jan2Feb3Mar4Apr5May6Jun7Jul8Aug9Sep10Oct11Nov12Dec";
signed main() {
IOS
string s;
cin >> s;
string t1;
int t2;
for (int i = 0; i < s.size(); i++) {
if (!(s[i] >= '0' && s[i] <= '9')) {
t1 += s[i];
}
}
cout << S[S.find(t1) - 1] << ' ' << (s[3] - '0') * 10 + s[4] - '0';
return 0;
}