The Final Countdown

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Rumor has it that IOI 2048 is going to be held in Innopolis! In this regard, a large display counter was installed in Innopolis, indicating the number of nanoseconds before the start of the Olympiad! Initially, a certain number was set to be displayed, and every nanosecond this number decreases by one. Leading zeros are not displayed.

The digits are displayed using standard seven-segment indicators. The way the digits look is shown in the picture:

Nanoseconds change so quickly that it’s almost impossible to see the number the display shows at the moment. But, by connecting a high-precision sensor attached to the power cord of the display, it was possible to obtain the values a_ia\_i — the number of segments turned on during the each of nn nanoseconds in a row. Since there is still time before IOI 2048, the number on the timer at any time was positive.

Write a program that calculates the number of possible initial values (corresponding to the measurement a_1a\_1), and any mm of these values. If the number of possible initial values are less than mm, you should print all of them.

입력

The first line contains two numbers nn and mm (1n1051 \le n \le 10^5, 0m100 \le m \le 10) — the number of nanoseconds and the number of values to print. The next line contains nn integers a_ia\_i (2a_i10002 \le a\_i \le 1000) — the number of segments that are turned on during the ii-th nanosecond.

출력

In the first line print kk — the number of possible initial values of the counter modulo 1,000,000,0071\\,000\\,000\\,007. Then, print mm different initial values of the number on the display, consistent with the given measurements. If the actual number of values (before taking it modulo 1,000,000,0071\\,000\\,000\\,007) is less than mm, print all the suitable values. You can print these numbers in any order, each one in a separate line.

힌트

In the first example, if initial value on the display is 1151, then it changes in the following way:

Number on the displayNumber of segments
11512+2+5+2=112 + 2 + 5 + 2 = 11
11502+2+5+6=152 + 2 + 5 + 6 = 15
11492+2+4+6=142 + 2 + 4 + 6 = 14
11482+2+4+7=152 + 2 + 4 + 7 = 15
11472+2+4+3=112 + 2 + 4 + 3 = 11

Other possible initial values are 451 and 761, you can print any of them.