#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int s;
  string str;
  cin >> n;
  for (int i = 1; i <= n * 2 - 2; i++) {
    getline(cin, str);
    for (s = 0; s < 1000; s++) {
      if (str[s] == 'H' && str[s + 1] == 'o' && str[s + 2] == 's' &&
              str[s + 3] == 'h' && str[s + 4] == 'i' && str[s + 5] == 'n' &&
              str[s + 6] == 'o' ||
          str[s] == 'H' && str[s + 1] == 'a' && str[s + 2] == 's' &&
              str[s + 3] == 'h' && str[s + 4] == 'i' && str[s + 5] == 'n' &&
              str[s + 6] == 'o') {
        str[s + 1] = 'o';
        str[s + 6] = 'a';
      }
    }
    cout << str << endl;
  }
}
