import sequtils, strutils let nk = stdin.readLine.split.map parseInt n = nk[0] k = nk[1] xss = n.newSeqWith stdin.readLine var ss = "" for xs in xss: var s = "" for x in xs: for _ in 0 ..< k: s &= x s &= "\n" ss &= s.repeat k stdout.write ss