#include <iostream>
using namespace std;
int main()
{
string months[13] = {"","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
string s;
cin >> s;
string month,day;
month = s.substr(0,3);
day += s.substr(3);
for(int i = 1;i < 13;i ++)
if(month == months[i]) cout << i << ' ';
// int d = (day[0] - '0') * 10 + (day[1] - '0');
// cout <<d;
cout << stoi(day);
return 0;
}