#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.txt"


int main() {
	while (1) {
		int y, m, d;
		if (!(cin >> y >> m >> d)) {
			return 0;
		}
		else {
			int hash = y * 10000 + m * 100 + d;
			string gou;
			if (hash >= 1989 * 10000 + 1 * 100 + 8) {
				gou = "heisei";
			}
			else if (hash >= 1926 * 10000 + 12 * 100 + 25) {
				gou = "showa";
			}
			else if (hash >= 1912 * 10000 + 7 * 100 + 30) {
				gou = "taisho";
			}
			else if(hash>=1868*10000+9*100+8){
				gou = "meiji";
			}
			else {
				gou = "pre-meiji";
			}
			if (gou == "pre-meiji") {
				cout << gou << endl;
			}
			else {
				cout << gou << " ";
				map<string, int>mp;
				mp["heisei"] = 1988;
				mp["showa"] = 1925;
				mp["taisho"] = 1911;
				mp["meiji"] = 1867;
				cout << y - mp[gou] << " "<<m << " " << d << endl;
			}
			
		}
	}

	return 0;
}