VUDBOL4 - New iPad

no tags 

The new iPad is here, with retina display. It has more resolution than iPad2. Because for each pixel in iPad2 exists 4 pixels in new iPad. That means that the new iPad has twice width and twice height.

With this new resolution we need change some icons’ sizes. But we don’t have time for create new images. We only change the black and white images. Create another image that is 4 pixels for each pixel of the old image.

Input

The input consists in multiple test cases.
Each test case begins a line containing an integer number “N” (1 <= N <= 50) the width and height of the icon. In the following "N" lines are "N" characters for line. The characters '1' means black pixels and '0' means white pixels.
The end of input is indicated by a line with one zero. This is not a part of any test cases.

Output

For each test case print a (N+N)*(N+N) matrix representing the new icon with the new resolution for the new iPad.

Example

Input:
4
1000
1011
1000
1111
2
10
01
0

Output:
11000000
11000000
11001111
11001111
11000000
11000000
11111111
11111111
1100
1100
0011
0011

hide comments
vaibhav gupta: 2012-05-09 05:07:51

i m getting SIGSEGV error..!!!Can anyone tell me what is my mistake..!!!

Helping: You have to read all the numbers in each line without any spaces between them, so if you use int it will give you runtime, use char or string, as you want

Last edit: 2012-05-10 02:05:41
(Tjandra Satria Gunawan)(曾毅昆): 2012-05-05 01:56:16

wow... tutorial level ;)

:C++:: 2012-05-04 04:30:21

can anyone provide extra text cases. i m getting wa.

Jared Deckard: 2012-05-03 21:20:05

@all: Try getting your time down to 0.00s

Goldie: 2012-05-03 19:31:09

I agree with Krishna Datt Mishra :v

Krishna Datt Mishra: 2012-05-03 19:20:09

I agree with magicsquare :v

magicsquare: 2012-05-03 17:49:11

I agree with Faris :v

Faris Muhammad Asmawi: 2012-05-03 15:44:30

I agree with TF :v

Tev Fredian: 2012-05-03 14:48:25

I agree with Tegar :v


Added by:Edwin Guzman
Date:2012-04-25
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ASM32-GCC MAWK BC C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JAVA JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET