#include <stdio.h>
int main(){
    int a,b,c;
    while(scanf("%d%d%d",&a,&b,&c)!=EOF){
        if(a>1989)printf("heisei %d %d %d\n",a-1988,b,c);
        else if(a==1989){
            if(b>1)printf("heisei %d %d %d\n",a-1988,b,c);
            else if(c>=8)printf("heisei %d %d %d\n",a-1988,b,c);
            else printf("showa %d %d %d\n",a-1925,b,c);
        }
        else if(a>1926)printf("showa %d %d %d\n",a-1925,b,c);
        else if(a==1926){
            if(b==12&&c>=25)printf("showa %d %d %d\n",a-1925,b,c);
            else printf("taisho %d %d %d\n",a-1911,b,c);
        }
        else if(a>1912)printf("taisho %d %d %d\n",a-1911,b,c);
        else if(a==1912){
            if(b>7)printf("taisho %d %d %d\n",a-1911,b,c);
            else if(b==7&&c>=30)printf("taisho %d %d %d\n",a-1911,b,c);
            else printf("meiji %d %d %d\n",a-1867,b,c);
        }
        else if(a>1868)printf("meiji %d %d %d\n",a-1867,b,c);
        else if(a==1868){
            if(b>9)printf("meiji %d %d %d\n",a-1867,b,c);
            else if(b==9&&c>=8)printf("meiji %d %d %d\n",a-1867,b,c);
            else printf("pre-meiji\n");
        }
        else printf("pre-meiji\n");
    }
}