#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
//#include <tuple>
#include <set>
#include <string.h>
#include <functional>

#define X first
#define Y second
#define MP make_pair
//#define MT make_tuple
#define REP(i, a, n) for(int (i) = (a); (i) < (n); ++(i))
#define FOR(i, n) REP(i, 0, n)
typedef long long ll;
using namespace std;
const int MAX = 500;
const double eps = 0.0000001;

template<class T, class U>
void convert(T &t, U &u)
{
	stringstream ss;
	ss << t;
	ss >> u;
}

const int  MEIJI_Y = 1868,  MEIJI_M =  9,  MEIJI_D =  8;
const int TAISHO_Y = 1912, TAISHO_M =  7, TAISHO_D = 30;
const int  SHOWA_Y = 1926,  SHOWA_M = 12,  SHOWA_D = 25;
const int HEISEI_Y = 1989, HEISEI_M =  1, HEISEI_D =  8;

int main()
{
	int y, m, d;
	while( cin >> y >> m >> d ){
		if( cin.eof() ) break;
		
		if( y < 1868 )
			{ cout << "pre-meiji" << endl; continue; }
		
		if( y == 1868 && m < 9 )
			{ cout << "pre-meiji" << endl; continue; }
		
		if( y == 1868 && m == 9 && d < 8 )
			{ cout << "pre-meiji" << endl; continue; }
		
		if( MEIJI_Y <= y && y <= TAISHO_Y ){
			if( y == TAISHO_Y ){
				//ギリ大正.
				if( m > TAISHO_M ){
					printf("taisho 1 %d %d\n", m, d); continue;
				}
				if( m == TAISHO_M && d >= TAISHO_D ){
					printf("taisho 1 %d %d\n", m, d); continue;
				}
			}
			//明治.
			printf("meiji %d %d %d\n", y - MEIJI_Y + 1, m, d); continue;
		}

		if( TAISHO_Y < y && y <= SHOWA_Y ){
			if( y == SHOWA_Y ){
				//ギリ昭和.
				if( m > SHOWA_M ){
					printf("showa 1 %d %d\n", m, d); continue;
				}
				if( m == SHOWA_M && d >= SHOWA_D ){
					printf("showa 1 %d %d\n", m, d); continue;
				}
			}
			//大正.
			printf("taisho %d %d %d\n", y - TAISHO_Y + 1, m, d); continue;
		}

		if( SHOWA_Y < y && y <= HEISEI_Y ){
			if( y == HEISEI_Y ){
				//ギリ平成.
				if( m > HEISEI_M ){
					printf("heisei 1 %d %d\n", m, d); continue;
				}
				if( m == HEISEI_M && d >= HEISEI_D ){
					printf("heisei 1 %d %d\n", m, d); continue;
				}
			}
			//昭和.
			printf("showa %d %d %d\n", y - SHOWA_Y + 1, m, d); continue;
		}

		if( HEISEI_Y < y ){
			//平成.
			printf("heisei %d %d %d\n", y - HEISEI_Y + 1, m, d); continue;
		}
		
	}
	return 0;
}