Language accepted by NFA

The problem assignment is available in format pdf:

Public data

The public data set is intended for easier debugging and approximate program correctness checking. The public data set is stored also in the upload system and each time a student submits a solution it is run on the public dataset and the program output to stdout a stderr is available to him/her.

Public data

Additional
Input
1000 10 2
6 11 2 5 17 9
5 200 300 400 520 600
Output
INFINITE bj
Input
13000 3 2
2 14 1 3 11 4
1 12903
Output
FINITE ababaababbccbbaacaacacb