Author: | A. Klenin, I. Ludov | Time limit: | 2 sec | |
Input file: | input.txt | Memory limit: | 64 Mb | |
Output file: | output.txt |
Young black-hat hacker Vasya routinely installs key loggers on every computer he can get his hands on. Browsing the logs collected, he sometimes can glance passwords of unaware users.
The IT department of the university where Vasya studies noticed suspicious activity and introduced a new, more secure way to enter passwords. Instead of password input field, window with 9 buttons is displayed. Buttons are arranged into 3×3 grid as shown in the table below.
7 | 8 | 9 |
4 | 5 | 6 |
1 | 2 | 3 |
To overcome this scheme, Vasya downloaded another cool program: mouse logger. It saves coordinates of clicks in a file, which Vasya is later able to browse. However, a complication has arisen: no information is saved about the position of password window on the screen. Indeed, it might even be partially off screen!
Your program must, given the series of mouse clicks, determine all possible corresponding passwords.
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|