import std.stdio, std.string, std.conv, std.range, std.algorithm, std.regex;

void main() {
  auto HW = readln.chomp.split.map!(to!int);
  auto H = HW[0];

  foreach (_; 0 .. H) {
    auto C = readln;
    C.write;
    C.write;
  }
}
