import java.io.*;
public class wareki_seireki {
public static void main
(String args
[]) {
int x_nen, y_tuki, z_hi, r_all;
System.
out.
print("input integer: ");
try{
String nen
= buf.
substring(0,
4); String tuki
= buf.
substring(4,
6); String hi
= buf.
substring(6,
8); String all
= buf.
substring(0,
8);
x_nen = 0;
y_tuki=0;
z_hi=0;
r_all = 0;
}
if(18691023<=r_all && 19120729>=r_all && 01<=y_tuki && 13>y_tuki && 01<=z_hi && 32>z_hi) {
int meiji=x_nen-1868;
System.
out.
println(("明治")+meiji
+("年")+y_tuki
+("月")+(++z_hi
)+("日")); }
if(19120730<=r_all && 19261224>=r_all && 01<=y_tuki && 13>y_tuki && 01<=z_hi && 32>z_hi) {
int taisyo=x_nen-1911;
System.
out.
println(("大正")+taisyo
+("年")+y_tuki
+("月")+z_hi
+("日")); }
if(19261225<=r_all && 19890107>=r_all && 01<=y_tuki && 13>y_tuki && 01<=z_hi && 32>z_hi) {
int syowa=x_nen-1925;
System.
out.
println(("昭和")+syowa
+("年")+y_tuki
+("月")+z_hi
+("日")); }
if(19890108<=r_all && 20121231>=r_all && 01<=y_tuki && 13>y_tuki && 01<=z_hi && 32>z_hi) {
int heisei=x_nen-1988;
System.
out.
println(("平成")+heisei
+("年")+y_tuki
+("月")+z_hi
+("日")); }
}
}
CmltcG9ydCBqYXZhLmlvLio7IApwdWJsaWMgY2xhc3Mgd2FyZWtpX3NlaXJla2kgewoJCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmcgYXJnc1tdKQogICAgewogICAgICAgICAgICBpbnQgeF9uZW4sIHlfdHVraSwgel9oaSwgcl9hbGw7CiAgCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnQoImlucHV0IGludGVnZXI6ICIpOwogICAgICAgICAgICAKICAgICAgICAgICAgSW5wdXRTdHJlYW1SZWFkZXIgaXNyID0gbmV3IElucHV0U3RyZWFtUmVhZGVyKFN5c3RlbS5pbik7CiAgICAgICAgICAgIEJ1ZmZlcmVkUmVhZGVyIGJyID0gbmV3IEJ1ZmZlcmVkUmVhZGVyKGlzcik7CiAgICAgICAgICAgIAogICAgICAgICAgICB0cnl7CiAgICAgICAgICAgIAkKICAgICAgICAgICAgCVN0cmluZyBidWYgPSBici5yZWFkTGluZSgpOyAKICAgICAgICAgICAgCVN0cmluZyBuZW4gPSBidWYuc3Vic3RyaW5nKDAsNCk7CiAgICAgICAgICAgIAlTdHJpbmcgdHVraSA9IGJ1Zi5zdWJzdHJpbmcoNCw2KTsKICAgICAgICAgICAgCVN0cmluZyBoaSA9IGJ1Zi5zdWJzdHJpbmcoNiw4KTsKICAgICAgICAgICAgCVN0cmluZyBhbGwgPSBidWYuc3Vic3RyaW5nKDAsOCk7CiAgICAgICAgICAgIAkKICAgICAgICAgICAgCXhfbmVuID0gSW50ZWdlci5wYXJzZUludChuZW4pOyAKICAgICAgICAgICAgCXlfdHVraSA9IEludGVnZXIucGFyc2VJbnQodHVraSk7IAogICAgICAgICAgICAJel9oaSA9IEludGVnZXIucGFyc2VJbnQoaGkpOyAKICAgICAgICAgICAgCXJfYWxsID0gSW50ZWdlci5wYXJzZUludChhbGwpOwogICAgICAgICAgICAJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgfWNhdGNoKEV4Y2VwdGlvbiBlKXsgCiAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIHhfbmVuID0gMDsKICAgICAgICAgICAgICAgICAgICB5X3R1a2k9MDsKICAgICAgICAgICAgICAgICAgICB6X2hpPTA7CiAgICAgICAgICAgICAgICAgICAgcl9hbGwgPSAwOwogICAgICAgICAgICB9CiAgICAgICAgICAKICAgICAgICAKICAgICAgICAgICAgaWYoMTg2OTEwMjM8PXJfYWxsICYmIDE5MTIwNzI5Pj1yX2FsbCAgJiYgMDE8PXlfdHVraSAmJiAxMz55X3R1a2kgJiYgMDE8PXpfaGkgJiYgMzI+el9oaSkgewogICAgICAgIAkJaW50IG1laWppPXhfbmVuLTE4Njg7CiAgICAgICAg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