#include <stdio.h>

void era_name_translation(int x, int y, int z)
{
    int n;
    n = x * 10000 + y * 100 + z;
    if (n <= 18680907) {
        printf("pre-meiji\n");
    }
    else if (18680907 <= n && n <= 19120729) {
        printf("meiji %d %d %d\n", x - 1868 + 1, y, z);
    } 
    else if (19120729 < n && n <= 19261224) {
        printf("taisho %d %d %d\n",x - 1912 + 1, y, z);
    }  
    else if (19261224 < n && n <= 19890107) {
        printf("showa %d %d %d\n",x - 1926 + 1, y, z);
    }  
    else if (19890107 < n ) {
        printf("heisei %d %d %d\n",x - 1989 + 1, y, z);
    }     
}

int main(void)
{
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    era_name_translation(a, b, c);
    return 0;
}