In the event of technical difficulties with Szkopuł, please contact us via email at firstname.lastname@example.org.
If you are familiar with IRC chat, the support team is also reachable on PIRC network (
#szkopul channel. If you are not, just use email.
Please do not ask us things like "how to solve task XYZ?".
Please remember that the support team has to sleep sometimes or go to work in real life.
Binary Viruses Investigation Committee detected, that certain sequences of zeroes and ones are codes of viruses. The committee isolated a set of all the virus codes. A sequence of zeroes and ones is called safe, if any of its segments (i.e. sequence of consecutive elements) is not a virus code. The committee is aiming at finding, whether an infinite, safe sequence of zeroes and ones exists.
For a set of codes , the sample infinite safe sequence is For a set of codes an infinite safe sequence of zeroes and ones does not exist.
Write a program, which:
The first line of the standard input consists of one integer standing for the number of all virus codes. Each of the next lines consists of one non-empty word composed from 0s and 1s - a virus code. The total length of all words does not exceed 30000.
In the first and the only line of the standard output one should find a word:
For the input data:
3 01 11 00000
the correct result is:
Task author: Wojciech Rytter.