Scanner

Interview

Time limit1sMemory limit128 MB

Summary
Expand an R by C character grid by repeating each character ZR times vertically and ZC times horizontally, then print the result.
Level

Easy2 of 10

Topics
Simulation, Implementation, Array
Solved
No attempts yet

Problem

A student reads a newspaper every morning. As the print has become too small to read comfortably, the student wants to use a scanner to enlarge the text.

A newspaper article can be represented as a matrix of R*C characters. Each character is a letter, a digit, or a period.

The scanner receives two integers, ZR and ZC. It enlarges every original 1*1 character into a block that is ZR characters tall and ZC characters wide.

Given the article and the enlargement factors ZR and ZC, write a program that prints the scanned result.

Input

The first line contains four integers R, C, ZR, and ZC. R and C are between 1 and 50, inclusive, and ZR and ZC are between 1 and 5, inclusive.

Each of the next R lines contains one string representing a row of the newspaper article. Each string has length C.

Output

Print the enlarged scanner result over R*ZR lines. Each output line must contain exactly C*ZC characters.

Examples2

  1. Example 1

    Input
    3 3 1 2
    .x.
    x.x
    .x.
    
    Expected output
    ..xx..
    xx..xx
    ..xx..
    
  2. Example 2

    Input
    3 3 2 1
    .x.
    x.x
    .x.
    
    Expected output
    .x.
    .x.
    x.x
    x.x
    .x.
    .x.