public class matris<E>
 {	 
 public E[][] A;
 //constructor methods
 public matris(E[][] Ai)
 {   try{
	 A = (E[][]) new Object[Ai.length][Ai[0].length];
     }catch(bosmatrishatasi e){}
      catch(dolumatrishatasi f){};
   input_matris(Ai); 
 }
 
 public matris(matris< E > M)
 { 
	 try{
	 A=(E[][])new Object[M.A.length][M.A[0].length];
       }catch(bosmatrishatasi e){}
      catch(dolumatrishatasi f){};
	 input_matris(M.A); 
 }
 
 public matris(int n,int m)
 { try{
	 A=(E[][])new Object[n][m];    
	  }catch(bosmatrishatasi e){}
      catch(dolumatrishatasi f){}; 
 }
 
 public void input_matris(E[][] Ai)
 {   for(int i=0;i<A.length;i++)
	 { for(int j=0;j<A[0].length;j++)
	   {A[i][j]=Ai[i][j];}
     }
 }
 
 public String toString(matris< E > M)
 { int n=M.A.length;
   int m=M.A[0].length;
   String s="";
  for(int i=0;i<n;i++)
	 { for(int j=0;j<m;j++)
	   {s+=M.A[i][j]+" ";}
	 s+="\n";
	 }
 return s;
 }
 
 public String toString()
 {  
   int n=A.length;
   int m=A[0].length;
   String s1="";
   for(int i=0;i<n;i++)
   {  for(int j=0;j<m;j++)
    { s1+=String.format(" %s ",A[i][j]);}
   s1+="\n";
   }
 return s1;
 } //end of method toString	 	 
 
 }//end of class matris
