package 基礎題庫;
import java.util.Scanner;
public class a015 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] R= null;
int[] R_temp;
Scanner sc = new Scanner(System.in);
String input;
String[] Splite1 ;
int count1=0;
while(sc.hasNext())
{
input = sc.nextLine();
Splite1 = input.split(" ");
R_temp = new int [Splite1.length];
if(count1 ==0)
{
for(int i =0 ; i < Splite1.length;i++)
{
R_temp[i] = Integer.valueOf(Splite1[i]);
if(R_temp[i]>=100)
{
main(args);
}
}
R = new int[R_temp[0]][R_temp[1]];
}
if(count1!=0&&count1 <= R.length)
{
for(int i =0 ; i< Splite1.length;i++)
{
R[count1-1][i] = Integer.valueOf(Splite1[i]);
}
}
if(count1 ==R.length)
{
for(int j = 0 ;j <R[0].length;j++)
{
System.out.println();
for(int i =0; i < R.length ;i++)
{
if(i!=0&&i<R.length)
{
System.out.print(" ");
}
System.out.print(R[i][j]);
}
}
System.out.println();
main(args);
}
count1++;
}
}
}