#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

vector<int> dat, gannnen;
vector<string> name;

int toInt(int y, int m, int d) {
  return y*10000 + m*100 + d;
}

void make() {
  name.push_back("pre-meiji");
  dat.push_back(toInt(0,0,0));
  gannnen.push_back(0);
  name.push_back("meiji");
  dat.push_back(toInt(1868,9,8));
  gannnen.push_back(1868);
  name.push_back("taisho");
  dat.push_back(toInt(1912,7,30));
  gannnen.push_back(1912);
  name.push_back("showa");
  dat.push_back(toInt(1926,12,25));
  gannnen.push_back(1926);
  name.push_back("heisei");
  dat.push_back(toInt(1989,1,8));
  gannnen.push_back(1989);
}

int getInd(int date) {
  return distance(dat.begin(),upper_bound(dat.begin(), dat.end(), date)) - 1;
}

int main() {
  make();
  int y, m, d;
  while(cin >> y >> m >> d) {
    int i = getInd(toInt(y,m,d));
    if(i)
      cout << name[i] << " " << y-gannnen[i]+1 << " " << m << " " << d << endl;
    else
      cout << name[i] << endl;
  }
  return 0;
}