#include<stdio.h>
#include<stdlib.h>
#include<string.h>


int main(){
	int nen,ga,pi;
	
	while(0<=scanf("%d%d%d",&nen,&ga,&pi)){
		
		if(nen<1868){
			printf("pre-meiji\n");
			continue;
		}
		if(nen==1868){
			if(ga<9){
				printf("pre-meiji\n");
				continue;
			}else if(ga==9){
				if(pi<8){
					printf("pre-meiji\n");
					continue;
				}else{
					printf("meiji %d %d %d\n",nen+1-1868,ga,pi);
					continue;
				}
			}else{
				printf("meiji %d %d %d\n",nen+1-1868,ga,pi);
				continue;
			}
		}
		
		if(nen>1868 && nen<1912){
			printf("meiji %d %d %d\n",nen+1-1868,ga,pi);
			continue;
		}
		
		if(nen==1912){
			if(ga<7){
				printf("meiji %d %d %d\n",nen+1-1868,ga,pi);
				continue;
			}else if(ga==7){
				if(pi<30){
					printf("meiji %d %d %d\n",nen+1-1868,ga,pi);
					continue;
				}else{
					printf("taisho %d %d %d\n",nen+1-1912,ga,pi);
					continue;
				}
			}else{
				printf("taisho %d %d %d\n",nen+1-1912,ga,pi);
				continue;
			}
		}

		if(nen>1912 && nen<1926){
			printf("taisho %d %d %d\n",nen+1-1912,ga,pi);
			continue;
		}

		if(nen==1926){
			if(ga<12){
				printf("taisho %d %d %d\n",nen+1-1912,ga,pi);
				continue;
			}else if(ga==12){
				if(pi<25){
					printf("taisho %d %d %d\n",nen+1-1912,ga,pi);
					continue;
				}else{
					printf("showa %d %d %d\n",nen+1-1926,ga,pi);
					continue;
				}
			}else{
				printf("showa %d %d %d\n",nen+1-1926,ga,pi);
				continue;
			}
		}
		
		if(nen>1926 && nen<1989){
			printf("showa %d %d %d\n",nen+1-1926,ga,pi);
			continue;
		}

		if(nen==1989){
			if(ga<1){
				printf("showa %d %d %d\n",nen+1-1926,ga,pi);
				continue;
			}else if(ga==1){
				if(pi<8){
					printf("showa %d %d %d\n",nen+1-1926,ga,pi);
					continue;
				}else{
					printf("heisei %d %d %d\n",nen+1-1989,ga,pi);
					continue;
				}
			}else{
				printf("heisei %d %d %d\n",nen+1-1989,ga,pi);
				continue;
			}
		}

		printf("heisei %d %d %d\n",nen+1-1989,ga,pi);
	}
	return 0;
}