#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{

  string s;
  cin>>s;
  if(s=="SUN")cout<<"7"<<endl;
  if(s=="MON")cout<<"6"<<endl;
  if(s=="TUE")cout<<"5"<<endl;
  if(s=="WED")cout<<"4"<<endl;
  if(s=="THU")cout<<"3"<<endl;
  if(s=="FRI")cout<<"2"<<endl;
  if(s=="SAT")cout<<"1"<<endl;
}
  
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	int n; cin >> n;
	cin.ignore();
	while (n--) {
		string s;
		getline(cin, s);
		for (int i = 0; i + 6 < s.size(); i++) {
			if (s.substr(i, 7) == "Hoshino")s[i + 6] = 'a';
		}
		cout << s << endl;
	}
	return 0;
}