Problem:
Problem I: Mysterious Onslaught

In 2012, human beings have been exposed to fierce onslaught of unidentified mysterious extra-terrestrial creatures. We have exhaused because of the long war and can't regist against them any longer. Only you, an excellent wizard, can save us. Yes, it's time to stand up!

The enemies are dispatched to the earth with being aligned like an n * n square. Appearently some of them have already lost their fighting capabilities for some unexpected reason. You have invented a highest grade magic spell 'MYON' to defeat them all. An attack of this magic covers any rectangles (which is parallel to axis). Once you cast a spell "myon," then all the enemies which the magic covers will lose their fighting capabilities because of tremendous power of the magic. However, the magic seems to activate enemies' self-repairing circuit. Therefore if any enemy which have already lost its fighting capability is exposed to the magic, the enemy repossesses its fighting capability. You will win the war when all the enemies will lose their fighting capabilities.

Let me show an example. An array of enemies below have dispatched:

1 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1

Here, '0' means an enemy that doesn't possess fighting capability, and '1' means an enemy that possesses.
First, you cast a spell "myon" with covering all the enemies, which results in;

0 0 0 0 0
0 1 1 1 0
0 1 0 1 0
0 1 1 1 0
0 0 0 0 0

Next, cast once again with covering central 3 * 3 enemies.

0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0

Now you can defeat them all by casting a spell covers remaining one. Therefore you can cast "myonmyonmyon," which is the shortest spell for this case.

You are given the information of the array. Please write a program that generates the shortest spell that can defeat them all.

Input

The first line of each test case has an integer n. Following n lines are information of an array of enemies. The format is same as described in the problem statement.

Input terminates when n = 0.
You may assume that one or more enemy have fighting capability.

Output

For each dataset, output the shortest spell.

Constraints

1 ≤ n ≤ 5

Sample Input

5
1 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1
3
1 1 1
1 1 1
1 1 1
5
1 1 1 1 0
1 1 1 1 0
1 0 0 0 1
0 1 1 1 1
0 1 1 1 1
0

Output for the Sample Input

myonmyonmyon
myon
myonmyon

Solution in C# (judge verdict: Accepted)

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		while(true){
			var n=int.Parse(Console.ReadLine());
			if(n==0)break;
			Sol mySol =new Sol(n);
			mySol.Solve();
		}
	}
}

class Sol{
	public void Solve(){
//writeMap(Map));		
		Queue<int>[] Q=new Queue<int>[2];
		Q[0]=new Queue<int>();
		Q[1]=new Queue<int>();
		HashSet<int> H=new HashSet<int>();
		
		int cnt=0;
		Q[0].Enqueue(Map);
		
		while(Q[cnt%2].Count>0){
//if(cnt==2)return;
			while(Q[cnt%2].Count>0){
//Console.WriteLine("cnt={0},Q[{0}].Count={1}",cnt,Q[cnt%2].Count);
				int m=Q[cnt%2].Dequeue();
//writeMap(m);
//Console.WriteLine("masks are:");
				if(m==0){
					String S="";
					for(int i=0;i<cnt;i++)S+="myon";
					Console.WriteLine(S);
					return;
				}
				
				int x=m&-m;
				int idx=bitCnt(x-1);
				int cMax=idx;
				for(;cMax<(idx/N+1)*N;cMax++){
					//if(((m>>cMax)&0x1)==0)break;
				}
				cMax=cMax-idx;
				
				int rMax=idx;
				for(;rMax<N*N;rMax+=N){
					//if(((m>>rMax)&0x1)==0)break;
				}
				rMax=(rMax-idx)/N;
//Console.WriteLine("x={2},idx={3},cMax={0},rMax={1}",cMax,rMax,x,idx);
//bool chk=true;if(chk)return;
				for(int i=0;i<=rMax;i++){
					for(int j=0;j<=cMax;j++){
						int mask=0;
						for(int ii=0;ii<i;ii++){
							for(int jj=0;jj<j;jj++){
								mask=mask|x<<(ii*N+jj);
							}
						}
						if(mask==0)continue;
//writeMap(mask);
						if(!H.Contains(m^mask)){
							Q[(cnt+1)%2].Enqueue(m^mask);
							H.Add(m^mask);
//writeMap(m);
//writeMap(m^mask);
						}
					}
				}
			}
			cnt++;
		}
		
		
	}
	
	static int bitCnt(int x){
		x=(x&0x55555555)+((x>>1)&0x55555555);
		x=(x&0x33333333)+((x>>2)&0x33333333);
		x=(x&0x0F0F0F0F)+((x>>4)&0x0F0F0F0F);
		x=(x&0x00FF00FF)+((x>>8)&0x00FF00FF);
		x=(x&0x0000FFFF)+((x>>16)&0x0000FFFF);
		return x;
	}
	
	void writeMap(int x){
		List<char> L=new List<char>();
 		while(true){
			L.Add((char)('0'+(x&0x1)));
			x=x>>1;
			if(x==0)break;
		}
		
		char[] C=new char[N*N];
		for(int i=0;i<N*N;i++)C[i]='0';
		for(int i=0;i<L.Count;i++){
			C[N*N-1-i]=L[i];
		}
		String s=new String(C);
		for(int i=0;i<N;i++){
			Console.WriteLine(s.Substring(i*N,N));
		} 
		
		Console.WriteLine("");
	}

	int N;
	int Map;
	public Sol(int n_){
		N=n_;
		Map=0;
		for(int i=0;i<N;i++){
			var d=ria();
			for(int j=0;j<N;j++){
				//左上が最下位bit
				Map=Map|(d[j]<<i*N+j);
				//Console.WriteLine(Map);
			}
		}
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}