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