//0083 Era Name Transformation
#include<iostream>
using namespace std;
int main() {
	int y, m, d;
	while (cin >> y >> m >> d){
		int num;
		if (y < 1868)
			cout << "pre-meiji\n";
		else if (y == 1868) {
			num = (m * 40 + d);
			if (num < 368)
				cout << "pre-meiji\n";
			else
				cout << "meiji 1 " << m << ' ' << d << endl;
		}
		else if (y > 1868 && y <= 1911)
			cout << "meiji " << y - 1867 << ' ' << m << ' ' << d << endl;
		else if (y == 1912) {
			num = (m * 40 + d);
			if (num < 310)
				cout << "meiji 45 " << m << ' ' << d << endl;
			else cout << "taisyo 1 " << m << ' ' << d << endl;
		}
		else if (y > 1912 && y < 1926)
			cout << "taisyo " << y - 1911 << ' ' << m << ' ' << d << endl;
		else if (y == 1926) {
			num = (m * 40 + d);
			if (num < 505)cout << "taisyo 15 " << m << ' ' << d << endl;
			else cout << "showa 1 " << m << ' ' << d << endl;
		}
		else if (y > 1926 && y < 1989)
			cout << "showa " << y - 1925 << ' ' << m << ' ' << d << endl;
		else if (y == 1989){
			num = (m * 40 + d);
			if (num < 48)cout << "showa 64 " << m << ' ' << d << endl;
			else cout << "heisei 1 " << m << ' ' << d << endl;
		}
		else cout << "heisei " << y - 1988 << ' ' << m << ' ' << d << endl;
	}
	return 0;
}