    #include <iostream>
    #include <cstring>
    using namespace std;
     
    int strPeriod(char *str){
    	int period;
    	period = strlen(str); // 
    	for(int i=1; i<=(strlen(str)/2); i++){
    		int j;
    		for(j=0; j<strlen(str)-i; ){
    			if(str[j] == str[j+i]){
    				j++;
    			}
    			else{
    				break;
    			}
    		}
     	if(j == (strlen(str) - i)){
    				period = i;
    				break;
    		}
    	}
     
    	return period;
    }
     
    int main() {
    	const int n = 81;
   		int tests;
   		cin >> tests;
   		cin.ignore(1, ' ');
    	char *str = new char[n];
    	for(int j=0; j<tests; j++){
    		cin.getline(str, n);
    		cout << strPeriod(str);
    		if(j != tests - 1){
    			cout << endl << endl;
    		}
    	}
    	return 0;
    }