use std::io::Read; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut s = s.lines(); let v: Vec = s.next().unwrap().split(' ').flat_map(str::parse).collect(); let (n, k) = (v[0], v[1]); let a: Vec> = s.map(|s| s.chars().collect()).collect(); (0..n * k).for_each(|i| { println!( "{}", (0..n * k).map(|j| a[i / k][j / k]).collect::() ) }) }