Rikka was walking around the school building curiously until a strange room with a door number of 404 caught her eyes.
It seemed like a computer room --- there were dozens of computers lying orderly, but papers, pens, and whiteboards everywhere built up a nervous atmosphere. Suddenly, Rikka found some mysterious codes displayed on a computer which seemed to have nothing different from others --- is this a message from
inner world?
Excited Rikka started her exploration. The message was generated by a program named
for_patterns_in_mobius which outputted a string s of length

, containing the value of
%20%5Crvert)
for

in order.
Suddenly, Rikka heard footsteps outside. She quickly took a screenshot and left. The screenshot recorded a string t of length 200, perhaps a substring of s. Now Rikka wonders if it is really a substring of s, and if so, where it first appears in s.
Could you help her to decipher the codes?
输入描述:
There are 10 lines in total. Each line contains 20 characters, each of which is either "0" or "1". t is the concatenation of them --- the result of concatenating them in order.
输出描述:
Output a single integer in the only line. If t is a substring of s, output the first position it appears in s, that is, the minimum positive integer p such that all the digits
for
form the string t. Otherwise output -1.
示例1
输入
复制
11101110011011101010
11100100111011101110
11100110001010101110
11001110111011001110
01101110101011101000
11101110111011100110
01100010111011001110
11101100101001101110
10101110010011001110
11101110011011101010
示例2
输入
复制
01010101010101010101
10101010101010101010
01010101010101010101
10101010101010101010
01010101010101010101
10101010101010101010
01010101010101010101
10101010101010101010
01010101010101010101
10101010101010101010
备注:
The definition of
is as follows:
For any positive integer x, let
be the regular factorization of x, where
is a unique prime,
is a positive integer, and if x=1 then k=0. Consequently,
is defined as
%3D%0A%5Cbegin%7Bcases%7D%0A0%20%26%20%5Cexists%20c_i%3E1%2C%20%5C%5C%0A(-1)%5Ek%20%26%20%5Ctext%7Botherwise%7D%20%5C%5C%0A%5Cend%7Bcases%7D)