We say that a string has a period if it can be formed by concatenating one or more identical substrings of length . For example, the string "abcabcabcabc" has a period of , as it can be created by concatenating substrings of "abc". It also has a period of (by concatenating two substrings of "abcabc") and (the entire string "abcabcabcabc").
Write a program that determines the smallest period of a given string.
The first line contains the number of test cases . Each test case is presented on a separate line and consists of at most characters, without spaces.
For each test case, output the smallest period of the string. Separate the outputs for different test cases with a blank line.
Example 1