#include <iostream>
#include <string>

using namespace std;
int main(){
	int n , i , j , k ,x ;
	string str;
	cin >> n ;
	i=1;
	while( getline( cin , str ) ){
		x = str.find("hoshino");
		if ( x!=-1 ){
			cout << x << endl;
			str = str.replace( x , x+1 , "hoshina" );
			cout << str << endl;
	    }
	    else 
	    	cout <<"NA" << endl;
	    i ++ ;
	    if( i==n ) break;
	}
}