beecrowd | 2049

Numbers of Ahmoc

By IX Maratona de Programação IME-USP, 2005 BR Brazil

Timelimit: 1

Before the Hispanic colonization and then the English one, the region of San Antonio was dominated by Indians ahmoc-axhozupeck, ancestors of the Sioux and Apaches. Ethnicity was completely destroyed by the colonists in the eighteenth century, making impossible the task of deciphering their large panels.

The Department of Archaeology at Baylor University devotes much of his research to the panels of Ahmoc Indians. Surprisingly the Indians already knew the Hindu numerals, but they did not use it for calculations (after all trade in that civilization did not exist). Baylor archaeologists suspect that the panels full of numbers were merely decorative. Also suspect that some patterns that recurred were signatures of the artists in order to ensure the authenticity of the panel.

Your task in this problem is to see if the panels are true, ie, if, indeed, contain the signature of the artist that the archaeologist suspected to be the author.


Several test instances are given. Each instance starts with a positive integer 0 ≤ a ≤ 1000000 which is the signature of the artist. The integer 0 indicates the end of data. The next line is the sequence number of the panel, which can be up to 300000 digits.


For each solved instance, you should print "Instance h" where h is an integer, and increasing sequential number starting from 1. On the next line, you should print "verdadeiro" (true) if the sequence of numbers contains the signature of the artist or "falsa" (false) if otherwise. A blank line should separate the output of each instance.

Sample Input Sample Output


Instancia 1

Instancia 2