Plus
Pin


Problem description Progress
ID 38253. Audio recordings
Темы: Other   

More than anything, Pasha loves two things — music and order. Every day, when Pasha returns home, he turns on his laptop, goes to his page on the blue social network and listens to the songs added to his audio recording. The most difficult — choose which song to start listening to music today.

Of course, Pasha could choose the opening song somehow at random, guided by today's mood and current preferences in music. But there is no order in this. Therefore, Pasha came up with a clear scheme for choosing the starting song.

A long time ago, when Pasha once again suffered from a lack of order in the world around him, he promised himself that in his audio recordings there would always be such a number of songs N that the numbers in N did not repeat and there was no 0 among them. Such a number seemed to him practically perfect.

It was from this almost ideal number that Pasha decided to proceed when choosing the initial song. The selection scheme looks like this: first, Pasha looks at the number of songs in his audio recordings N. In this number, he swaps the numbers, sorting them in ascending order. So he gets the perfect number. Then he multiplies this ideal number by his favorite number 9. Here he could have stopped, but sometimes this work turns out to be too large, so Pasha takes the sum of the digits of the work as the number of the initial song.

Based on the number of songs in Pasha's recordings, print the number of the initial song for today.

Input
Given a natural number N. It is guaranteed that there is no digit 0 among the digits of N. All digits of N are different.

Imprint
Print a single number — desired number of the starting song.

Examples
# Input Output
1 321 9

ID 38508. Fine drawing
Темы: Symbols    Strings    Other   

There is an image with a height of H pixels and a width of W pixels. Each pixel is represented by either the character . or *. The character representing the pixel in the ith row from the top and the jth column from the left is denoted by Ci,j . Stretch this image vertically so that its height is doubled. That is, print the image  a height of 2H pixels and a width of W pixels, where the pixel in the i-th row and j-th column is < code>C(i+1)/2,j (the result of division is rounded down).

Input
The first line contains two integers H and (\(1 <= H, W <=100\ )). Then there are H lines by W characters per line, where each character is either . or *.

Imprint
Display the stretched image.
 

 

Examples
# Input Output
1
2 2
*.
.*
*.
*.
.*
.*
2
14
***.
***.
***.
3
9 20
.....***....***.....
....*...*..*...*....
...*.....**.....*...
...*.....*......*...
....*.....*....*....
...**..*...**.....
.......*..*.*.......
........**.*........
.........**.........
.....***....***.....
.....***....***.....
....*...*..*...*....
....*...*..*...*....
...*.....**.....*...
...*.....**.....*...
...*.....*......*...
...*.....*......*...
....*.....*....*....
....*.....*....*....
...**..*...**.....
...**..*...**.....
.......*..*.*.......
.......*..*.*.......
........**.*........
........**.*........
..........**.........
.........**.........