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

struct era {
    char era_name[8];
    int era_year;
};

void trans(int year, int month, int day);

int main(void)
{
    int year, month, day;
    while (scanf("%d %d %d", &year, &month, &day) != EOF) {
	trans(year, month, day);
    }
    return 0;
}


void trans(int year, int month, int day)
{
    int n = 0;
    struct era data;
    if (year - 1989 > 1) {
	strcpy(data.era_name, "heisei");
	data.era_year = year - 1989 + 1;
    } else if (year -1989 == 0) {
	if (month - 1 > 0) {
	    strcpy(data.era_name, "heisei");
	    data.era_year = 1;
	} else if (month - 1 == 0) {
	    if (day - 8 >= 0) {
		strcpy(data.era_name, "heisei");
		data.era_year = 1;
	    } else {
		strcpy(data.era_name, "showa");
		data.era_year = 64;
	    }
	}
    } else if (year - 1926 > 0) {
	strcpy(data.era_name, "showa");
	data.era_year = year - 1926 + 1;
    } else if (year - 1926 == 0) {
	if (month - 12 == 0) {
	    if (day - 25 >= 0){
		strcpy(data.era_name, "showa");
		data.era_year = 1;
	    } else {
		strcpy(data.era_name, "taisho");
		data.era_year = 15;
	    }
	} else {
	    strcpy(data.era_name, "taisho");
	    data.era_year = 15;
	}
    } else if (year - 1912 > 0) {
	strcpy(data.era_name, "taisho");
	data.era_year = year - 1912 + 1;
    } else if (year - 1912 == 0) {
	if (month - 7 > 0) {
	    strcpy(data.era_name, "taisho");
	    data.era_year = 1;
	} else if (month - 7 == 0) {
	    if (day - 30 >= 0) {
		strcpy(data.era_name, "taisho");
		data.era_year = 1;
	    } else {
		strcpy(data.era_name, "meiji");
		data.era_year = 45;
	    }
	} else {
	    strcpy(data.era_name, "meiji");
	    data.era_year = 45;
	}
    } else if (year - 1868 > 0) {
	strcpy(data.era_name, "meiji");
	data.era_year = year - 1868 + 1;
    } else if (year - 1868 == 0) {
	if (month - 9 > 0) {
	    strcpy(data.era_name, "meiji");
	    data.era_year = 1;
	} else if (month - 9 == 0) {
		if (day - 8 >= 0) {
		    strcpy(data.era_name, "meiji");
		    data.era_year = 1;
		} else {
		    n += 1;
		}
	} else {
	    n += 1;
	}
    } else {
	n += 1;
    }
    if (n == 1) {
	printf("pre-meiji\n");
    } else {
	printf("%s %d %d %d\n", data.era_name, data.era_year, month, day);
    }
}
		
	    
   	    