public String read_square(char[][] square, boolean row)
	{
		StringBuilder sb=new StringBuilder();
		if(row)
		{
		  for(int i=0;i<square.length;i++)
		  {
			  for(int j=0;j<square[0].length;j++)
			  {
				  if(square[i][j]!='\0')
				  {
				    sb.append(square[i][j]);
				  }
			  }
		  }
		}
		else
		{
			for(int i=0;i<square[0].length;i++)
			  {
				  for(int j=0;j<square.length;j++)
				  {
					  if(square[j][i]!='\0')
					  {
					    sb.append(square[j][i]);
					  }
				  }
			  }
		}
		return sb.toString();
	}