This page is still under construction.

Parts of this page are still being built. What you see may change.

Hot fish-shaped bun

Time limit1sMemory limit32 MB

Summary
Print the given N by M binary picture mirrored left to right.
Level

Easy1 of 10

Topics
Matrix, Implementation
Solved
No attempts yet

Problem

Hodori, a first-year student at Korea University, walked past Anam Station and met a street vendor selling fish-shaped buns.

"Hi, hi, hi there, sir! Two fish buns, please."

"You said hi three times, so three fish buns!"

Hodori paid for two buns, got three, and was in a good mood. He pulled one out and took a bite, but it was so hot that he dropped it.

A fish-shaped bun falling to the ground

The bun landed mirrored left to right. Given the shape of the bun before the bite, print the shape it has once it lands.

Input

The first line holds two integers NN and MM separated by a space (0≤N≤100 \le N \le 10, 0≤M≤100 \le M \le 10).

Each of the next NN lines holds the shape of the bun. A line is a string of MM characters, where 0 is empty space and 1 is part of the bun. When MM is 00, each of those lines is empty.

Output

Print the bun mirrored left to right, on NN lines. When NN is 00, print nothing.

Hint

Reverse each line before printing it. Column 1 of row 1 in the input becomes column MM of row 1 in the output, column 2 of row 1 becomes column M−1M-1, and by the same rule column MM of row NN becomes column 1 of row NN.

Examples2

  1. Example 1

    Input
    5 7
    0010000
    0111010
    1111111
    0111010
    0010000
    
    Expected output
    0000100
    0101110
    1111111
    0101110
    0000100
    
  2. Example 2

    Input
    3 4
    1100
    0110
    0001
    
    Expected output
    0011
    0110
    1000