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

int main()
{
	int a,b,c;
	while(cin >> a >> b >> c)
	{
		
		if(a < 1868) cout << "pre-meiji" << endl;

		else if(a == 1868 && b < 9)
		{
			cout << "pre-meiji" << endl;
		}

		else if(a == 1868 && b == 9)
		{
			if(c < 8)
			{
				cout << "pre-meiji" << endl;
			}
			else
			{
				cout << "meiji " << a - 1867 << " " << b << " " << c << endl;
			}
		}

		else if((a == 1868 && b > 9) || (1868 < a && a < 1912))
		{
			cout << "meiji " << a - 1867 << " " << b << " " << c << endl;
		}

		else if(a == 1912 && b < 7)
		{
			cout << "meiji " << a - 1867 << " " << b << " " << c << endl;
		}

		else if(a == 1912 && b == 7)
		{
			if(c < 30)
			{
				cout << "meiji " << a - 1867 << " " << b << " " << c << endl;
			}
			else
			{
				cout << "taisyo " << a - 1911 << " " << b << " " << c << endl;
			}
		}

		else if((a == 1912 && b > 7) || (1912 < a && a < 1926))
		{
			cout << "taisyo " << a - 1911 << " " << b << " " << c << endl;
		}

		else if(a == 1926 && b < 12)
		{
			cout << "taisyo " << a - 1911 << " " << b << " " << c << endl;
		}

		else if(a == 1926 && b == 12)
		{
			if(c < 25)
			{
				cout << "taisyo " << a - 1911 << " " << b << " " << c << endl;
			}
			else
			{
				cout << "syouwa " << a - 1925 << " " << b << " " << c << endl;
			}
		}

		else if(1926 < a && a < 1989)
		{
			cout << "syouwa " << a - 1925 << " " << b << " " << c << endl;
		}

		else if(a == 1989 && b == 1)
		{
			if(c < 8)
			{
				cout << "syouwa " << a - 1925 << " " << b << " " << c << endl;
			}
			else
			{
				cout << "heisei " << a - 1988 << " " << b << " " << c << endl;
			}
		}
		else if(a == 1989 && b > 1)
		{
			cout << "heisei " << a - 1988 << " " << b << " " << c << endl;
		}
		else
		{
			cout << "heisei " << a - 1988 << " " << b << " " << c << endl;
		}
	}
	return 0;
}