The first line of the input file contains two integers, N and K, separated by a space.
Starting from the second line there is a description of a buffers' state. The state of each buffer is represented by a single character:
- 0 - when the corresponding buffer is free.
- 1 - when the corresponding buffer is occupied and has worthiness of 1.
- 2 - when the corresponding buffer is occupied and has worthiness of 2.
- ...
- 9 - when the corresponding buffer is occupied and has worthiness of 9.
- * - when the corresponding buffer is locked.
Those characters are situated on the consecutive lines grouped by 80 characters per line without any spaces. Thus, each line starting from the second one contains exactly 80 characters with a possible exception for the last line.