p00083 Era Name Transformation_28767
Create a program that converts the date expressed in the Christian era to the Japanese calendar using the era name and outputs the date. The input is three integers, as shown in the example, in the order year, month, and day. Convert this as shown in the sample output. If the date before the Meiji era is entered, please display "pre-meiji".

The first year of each year will be output as "1 year" instead of "first year".

Era | Period
--- | ---
meiji | 1868. 9. 8 ~ 1912. 7.29
taisho | 1912. 7.30 ~ 1926.12.24
showa | 1926.12.25 ~ 1989. 1. 7
heisei | 1989. 1. 8 ~




input

Multiple data are given. As each data, three integers representing year, month and day are given on one line separated by blanks.

Please process until the end of the input. The number of data does not exceed 50.

output

Output the blank-separated era, year, month, day, or "pre-meiji" on one line.

Example

Input

2005 9 3
1868 12 2
1868 9 7


Output

heisei 17 9 3
meiji 1 12 2
pre-meiji
while 1:
#n=int(raw_input())
    try:
        y,m,d=map(int,raw_input().split())
        if (y<=1868 and m<=9 and d<8) or (y<=1868 and m<=8) or y<=1867:
            print 'pre-meiji'
        elif (y<=1912 and m<=7 and d<30) or (y<=1912 and m<=6) or y<=1911:
            print 'meiji',y-1867,m,d
        elif (y<=1926 and m<=12 and d<25) or (y<=1926 and m<=11) or y<=1925:
            print 'taisho',y-1911,m,d
        elif (y<=1989 and m<=1 and d<8) or y<=1988:
            print 'showa',y-1925,m,d
        else:
            print 'heisei',y-1988,m,d
    except:
        break
2005 9 3
1868 12 2
1868 9 7 2005 5 3
1868 12 2
1868 9 7 2005 5 3
1868 12 2
1868 9 9 2005 7 3
1868 12 2
1868 9 9 2005 9 3
1868 12 3
1868 9 7 2005 5 3
1703 12 2
1868 9 7 2005 5 3
411 12 2
1868 9 9 2005 5 6
1703 12 2
1868 9 7 2005 9 3
1868 9 3
359 9 7 2005 5 6
1703 12 2
1868 9 11 2005 9 3
1868 10 3
359 9 7 2005 9 6
1703 10 1
1184 9 11 2005 5 3
1868 12 2
3210 9 7 2005 7 3
1868 12 2
1868 9 7 2005 5 2
1703 12 2
1868 9 7 2005 5 3
411 12 2
1868 9 10 1659 5 6
1703 12 2
1868 9 7 2965 9 3
1868 9 3
359 9 7 2005 9 4
1868 10 3
359 9 7 2534 5 6
1703 12 1
1868 9 11 2005 5 9
1703 12 1
1184 9 11 2005 9 5
1743 12 2
1868 9 7 2005 6 3
1868 12 2
3210 9 7 2005 7 3
1868 1 2
1868 9 7 4983 9 3
1868 9 3
359 9 7 2534 1 6
1703 12 1
1868 9 11 2005 10 9
1703 12 1
1184 9 11 2005 1 6
1703 10 1
1184 9 15 3559 9 5
1743 12 2
1868 9 7 2005 6 3
2027 12 2
3210 9 7 1810 5 2
1703 12 2
1868 9 9 2005 9 7
1868 10 3
359 9 14 2534 1 6
1703 12 1
309 9 11 3559 9 5
2425 12 2
1868 9 7 2005 6 3
2027 12 2
3210 9 1 1668 9 7
1868 10 3
359 9 14 2005 1 6
2268 10 2
1184 9 15 2005 6 3
2027 12 3
3210 9 1 1668 9 7
2354 10 3
359 9 14 2534 1 6
2096 12 1
309 9 14 3559 9 5
2425 12 2
2980 9 7 3080 6 3
2027 12 3
3210 9 1 2005 1 6
1920 10 2
1184 9 15 3559 9 5
2425 12 2
2980 9 14 3080 8 3
2027 12 3
3210 9 1 2005 6 3
53 5 1
581 9 2 2447 6 3
53 5 1
581 9 2 1668 9 2
2354 10 2
359 9 7 1214 1 6
2096 12 1
309 2 6 2005 1 6
1920 10 3
1184 6 15 2223 1 6
2096 12 1
309 2 6 2005 1 3
1920 10 3
1184 6 15 1668 8 2
2354 10 1
359 9 7 2005 1 1
1920 10 3
1184 6 19 2005 1 1
1627 10 3
1184 6 19 2005 1 2
1627 10 3
1184 6 19 2005 1 3
1627 10 3
1184 6 19 2005 9 3
1868 12 2
1868 4 7 2005 5 5
1868 12 2
1868 9 7 2005 7 3
1868 12 3
1868 9 9 2005 9 3
1868 12 3
3530 9 7 2005 5 1
1703 12 2
1868 9 7 2005 5 4
411 12 2
1868 9 9 2005 5 4
1703 12 2
1868 9 7 2005 4 3
1868 9 3
359 9 7 2005 9 3
3729 10 3
359 9 7 2005 11 3
1868 10 3
329 9 7 3378 9 3
373 10 3
329 9 7 2005 9 11
1703 10 1
1184 9 11 2005 5 3
1050 12 2
3210 9 7 2005 7 3
1868 12 2
1868 9 12 2005 9 2
1868 12 3
1868 6 7 2005 5 2
1703 12 2
3125 9 7 1659 5 6
1703 12 2
1868 9 10 2005 9 4
2465 10 3
359 9 7 2534 3 6
1703 12 1
1868 9 11 2005 9 3
1868 10 1
329 2 7 2005 9 6
2772 10 1
282 9 11 2005 7 3
1868 1 2
1868 9 11 3185 9 4
1868 10 3
359 9 14 2005 5 18
1703 12 1
1184 9 11 3559 9 5
2899 12 2
1868 9 7 2005 6 3
2027 12 1
3210 9 7 2005 7 6
900 1 2
1868 9 7 2005 5 3
411 5 1
2430 9 10 4983 9 4
1868 9 3
356 9 7 2005 9 7
1868 12 3
359 9 14 2005 2 6
1703 10 2
1184 9 15 3559 9 5
2425 12 1
1868 9 7 2005 6 3
2823 12 2
3210 9 1 2532 7 3
900 1 1
1868 9 7 4983 8 3
1868 9 3
356 9 12 2005 6 3
2027 12 3
2093 9 1 2297 5 3
411 5 1
581 9 2 529 9 6
1963 5 2
282 3 11 3559 9 7
2425 12 2
2980 9 7 3080 6 5
2027 12 3
3210 9 1 4983 10 3
601 9 3
356 9 12 2029 1 6
1920 10 2
1184 9 15 1668 9 2
3637 10 3
359 9 7 2350 1 6
1920 10 3
1184 6 15
heisei 17 9 3
meiji 1 12 2
pre-meiji heisei 17 5 3
meiji 1 12 2
pre-meiji
 heisei 17 5 3
meiji 1 12 2
meiji 1 9 9
 heisei 17 7 3
meiji 1 12 2
meiji 1 9 9
 heisei 17 9 3
meiji 1 12 3
pre-meiji
 heisei 17 5 3
pre-meiji
pre-meiji
 heisei 17 5 3
pre-meiji
meiji 1 9 9
 heisei 17 5 6
pre-meiji
pre-meiji
 heisei 17 9 3
pre-meiji
pre-meiji
 heisei 17 5 6
pre-meiji
meiji 1 9 11
 heisei 17 9 3
meiji 1 10 3
pre-meiji
 heisei 17 9 6
pre-meiji
pre-meiji
 heisei 17 5 3
meiji 1 12 2
heisei 1222 9 7
 heisei 17 7 3
meiji 1 12 2
pre-meiji
 heisei 17 5 2
pre-meiji
pre-meiji
 heisei 17 5 3
pre-meiji
meiji 1 9 10
 pre-meiji
pre-meiji
pre-meiji
 heisei 977 9 3
pre-meiji
pre-meiji
 heisei 17 9 4
meiji 1 10 3
pre-meiji
 heisei 546 5 6
pre-meiji
meiji 1 9 11
 heisei 17 5 9
pre-meiji
pre-meiji
 heisei 17 9 5
pre-meiji
pre-meiji
 heisei 17 6 3
meiji 1 12 2
heisei 1222 9 7
 heisei 17 7 3
pre-meiji
pre-meiji
 heisei 2995 9 3
pre-meiji
pre-meiji
 heisei 546 1 6
pre-meiji
meiji 1 9 11
 heisei 17 10 9
pre-meiji
pre-meiji
 heisei 17 1 6
pre-meiji
pre-meiji
 heisei 1571 9 5
pre-meiji
pre-meiji
 heisei 17 6 3
heisei 39 12 2
heisei 1222 9 7
 pre-meiji
pre-meiji
meiji 1 9 9
 heisei 17 9 7
meiji 1 10 3
pre-meiji
 heisei 546 1 6
pre-meiji
pre-meiji
 heisei 1571 9 5
heisei 437 12 2
pre-meiji
 heisei 17 6 3
heisei 39 12 2
heisei 1222 9 1
 pre-meiji
meiji 1 10 3
pre-meiji
 heisei 17 1 6
heisei 280 10 2
pre-meiji
 heisei 17 6 3
heisei 39 12 3
heisei 1222 9 1
 pre-meiji
heisei 366 10 3
pre-meiji
 heisei 546 1 6
heisei 108 12 1
pre-meiji
 heisei 1571 9 5
heisei 437 12 2
heisei 992 9 7
 heisei 1092 6 3
heisei 39 12 3
heisei 1222 9 1
 heisei 17 1 6
taisho 9 10 2
pre-meiji
 heisei 1571 9 5
heisei 437 12 2
heisei 992 9 14
 heisei 1092 8 3
heisei 39 12 3
heisei 1222 9 1
 heisei 17 6 3
pre-meiji
pre-meiji
 heisei 459 6 3
pre-meiji
pre-meiji
 pre-meiji
heisei 366 10 2
pre-meiji
 pre-meiji
heisei 108 12 1
pre-meiji
 heisei 17 1 6
taisho 9 10 3
pre-meiji
 heisei 235 1 6
heisei 108 12 1
pre-meiji
 heisei 17 1 3
taisho 9 10 3
pre-meiji
 pre-meiji
heisei 366 10 1
pre-meiji
 heisei 17 1 1
taisho 9 10 3
pre-meiji
 heisei 17 1 1
pre-meiji
pre-meiji
 heisei 17 1 2
pre-meiji
pre-meiji
 heisei 17 1 3
pre-meiji
pre-meiji
 heisei 17 9 3
meiji 1 12 2
pre-meiji
 heisei 17 5 5
meiji 1 12 2
pre-meiji
 heisei 17 7 3
meiji 1 12 3
meiji 1 9 9
 heisei 17 9 3
meiji 1 12 3
heisei 1542 9 7
 heisei 17 5 1
pre-meiji
pre-meiji
 heisei 17 5 4
pre-meiji
meiji 1 9 9
 heisei 17 5 4
pre-meiji
pre-meiji
 heisei 17 4 3
pre-meiji
pre-meiji
 heisei 17 9 3
heisei 1741 10 3
pre-meiji
 heisei 17 11 3
meiji 1 10 3
pre-meiji
 heisei 1390 9 3
pre-meiji
pre-meiji
 heisei 17 9 11
pre-meiji
pre-meiji
 heisei 17 5 3
pre-meiji
heisei 1222 9 7
 heisei 17 7 3
meiji 1 12 2
meiji 1 9 12
 heisei 17 9 2
meiji 1 12 3
pre-meiji
 heisei 17 5 2
pre-meiji
heisei 1137 9 7
 pre-meiji
pre-meiji
meiji 1 9 10
 heisei 17 9 4
heisei 477 10 3
pre-meiji
 heisei 546 3 6
pre-meiji
meiji 1 9 11
 heisei 17 9 3
meiji 1 10 1
pre-meiji
 heisei 17 9 6
heisei 784 10 1
pre-meiji
 heisei 17 7 3
pre-meiji
meiji 1 9 11
 heisei 1197 9 4
meiji 1 10 3
pre-meiji
 heisei 17 5 18
pre-meiji
pre-meiji
 heisei 1571 9 5
heisei 911 12 2
pre-meiji
 heisei 17 6 3
heisei 39 12 1
heisei 1222 9 7
 heisei 17 7 6
pre-meiji
pre-meiji
 heisei 17 5 3
pre-meiji
heisei 442 9 10
 heisei 2995 9 4
pre-meiji
pre-meiji
 heisei 17 9 7
meiji 1 12 3
pre-meiji
 heisei 17 2 6
pre-meiji
pre-meiji
 heisei 1571 9 5
heisei 437 12 1
pre-meiji
 heisei 17 6 3
heisei 835 12 2
heisei 1222 9 1
 heisei 544 7 3
pre-meiji
pre-meiji
 heisei 2995 8 3
pre-meiji
pre-meiji
 heisei 17 6 3
heisei 39 12 3
heisei 105 9 1
 heisei 309 5 3
pre-meiji
pre-meiji
 pre-meiji
showa 38 5 2
pre-meiji
 heisei 1571 9 7
heisei 437 12 2
heisei 992 9 7
 heisei 1092 6 5
heisei 39 12 3
heisei 1222 9 1
 heisei 2995 10 3
pre-meiji
pre-meiji
 heisei 41 1 6
taisho 9 10 2
pre-meiji
 pre-meiji
heisei 1649 10 3
pre-meiji
 heisei 362 1 6
taisho 9 10 3
pre-meiji
