using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication4 {
class Program {
static void Main( string[] args ) {
Console.Write( "Enter a String : " );
string text = Console.ReadLine();
Console.Write( "How many rows: " );
int rows = int.Parse( Console.ReadLine() );
Console.Write( "How many columns: " );
int cols = int.Parse( Console.ReadLine() );
Console.WriteLine( rows + "x" + cols );
char[] ctext = text.ToCharArray();
Random r = new Random();
int rn;
for ( int n = 0; n < cols; n++ ) {
rn = r.Next( text.Length );
Console.Write( ctext[rn] );
for ( int m = 0; m < rows; m++ ) {
rn = r.Next( text.Length );
Console.Write( ctext[rn] );
}
Console.Write( "\n" );
}
}
}
}