Second International  Programming Contest
March 28, 2004, Blagoevgrad, Bulgaria
Problem C
Asynchronous Device
An asynchronous input device produces a sequence of  integers, collecting in blocks. Every block consists of N+1 integers - data and a check sum, a number which is the sum of the previous N numbers. A program accepts the data, reading from a given port. But for a lack of synchronization not all numbers can be read by the program. Using the check sums, the "good" blocks can be identified. The program  has to store the data from "good" blocks in a file ignoring all "bad" data and check sums. Write this program! 
Input
The first line of the input contains two integer numbers N (2 < N < 600) and M < 106. The number N indicates how many numbers are contained in a block. The next M lines contain the data (positive integers with less than 60 digits), produced by the asynchronous input device. 
Output
The output file contains the numbers from "good" blocks. 
Sample Input
3 11 
1 
111111 
222222 
333333 
666666 
12345 
1 
1 
2 
3 
6 
Sample Output
111111 
222222 
333333 
1 
2 
3