#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	int y,m,d;
	string s;
	while(true){
		cin>>y>>m>>d;
		if (cin.eof())break;
		if(y>=1990){
			y-=1988;
			s="heisei";
		}
		else if(y==1989){
			if(m==1){
				if(d>=8) {
					y-=1988;
					s="heisei";
				}
				else {
					y-=1925;
					s="showa";
				}
			}
			if(m>=2) {
				y-=1988;
				s="heisei";
			}
		}
		else if(y<=1988&&y>=1927) {
			y-=1925;
			s="showa";
		}
		else if(y==1926){
			if(m==12&&d>=25) {
				y-=1925;
				s="showa";
			}
			else {
				y-=1911;
				s="taisho";
			}
		}
		else if(y>=1913&&y<=1925) {
			y-=1911;
			s="taisho";
		}
		else if(y==1912){
			if(m==7){
				if(d>=30) {
					y-=1911;
					s="taisho";
				}
				else {
					y-=1867;
					s="meiji";
				}
			}
			else if(m>=8) {
				y-=1911;
				s="taisho";
			}
			else{
				y-=1867;
				s="meiji";
			}
		}
		else if(y<=1911&&y>=1869){
			y-=1867;
			s="meiji";
		}
		else if(y==1868){
			if(m==9){
				if(d>=8){
					y-=1867;
					s="meiji";
				}
				else s="pre-meiji";
			}
			else if(m>=10){
				y-=1867;
				s="meiji";
			}
			else{
				s="pre-meiji";
			}
		}

		if(s!="pre-meiji") cout<<s<<" "<<y<<" "<<m<<" "<<d<<endl;
		else cout<<s<<endl;
	}
}