#include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int y, m, d;
	while (cin >> y >> m >> d) {
		string ans;
		int c;
		if ((y > 1989) || (y == 1989 && (m > 1 || (m == 1 && d >= 8)))) { ans = "heisei"; c = y - 1988; }
		else if ((y > 1926) || (y == 1926 && (m > 12 || (m == 12 && d >= 25)))) { ans = "showa"; c = y - 1925; }
		else if ((y > 1912) || (y >= 1912 && (m > 7 || (m == 7 && d >= 30)))) { ans = "taisho"; c = y - 1911; }
		else if ((y > 1868) || (y >= 1868 && (m > 9 || (m == 9 && d >= 8)))) { ans = "meiji"; c = y - 1867; }
		else { puts("pre-meiji"); continue; }
		cout << ans << ' ' << c << ' ' << m << ' ' << d << endl;
	}
	return 0;
}