AT_code_festival_china_a Lock

Description

[problemUrl]: https://atcoder.jp/contests/code-festival-2014-china-open/tasks/code_festival_china_a

Input Format

Input is given in the following format. > $ n $ - On the first line, you will be given $ n\ (1\ \leq\ n\ \leq\ 5) $, the number of digits of the dial lock.

Output Format

On the first line, output $ m $, the minimum number of procedures to try all combinations of digits. On the following $ m+1 $ lines, output the combination of digits that appears during the trial in order. If there are more than $ 1 $ possible answer, you may choose any one of them. Make sure to insert a line break at the end of the last line.

Explanation/Hint

### Problem Alice has a box locked with $ n $ digits dial lock. Each dial of the lock can be set to a digit from $ 0 $ to $ 9 $. Unfortunately, she forgot the passcode (of $ n $ digits). Now she will try all possible combinations of digits to unlock the key. She can do one of the following procedure each time. - Choose $ 1 $ dial and add $ 1 $ to that digit. (If the digit chosen was $ 9 $, it will be $ 0 $). - Choose $ 1 $ dial and subtract $ 1 $ from that digit. (If the digit chosen was $ 0 $, it will be $ 9 $). Curiously, she wants to try all combinations even if she found the correct passcode during the trials. But it is a hard work to try all the $ 10^n $ combinations. Help her by showing the way how to make the procedure less as possible. Initially, the combination of digits of the lock is set to $ 00..0 $. Calculate $ m $, the minimum number of procedures to try all combinations of digits, and show the $ m+1 $ combinations of digits after each procedures, including the initial combination $ 00..0 $. If there are more than one possible answer, you may choose any one of them. Checking if the current combination of digits matches the passcode doesn't count as a procedure. ### Sample Explanation 1 Don't forget to output the minimum number of procedures $ 9 $ on the first line. On the following lines, note that you have to output $ m+1 $ lines including the initial combination $ 0 $.