#include "bits/stdc++.h"
using namespace std;
const int N = 100005;
char s[N];
int ne[N];
int num[N];
int main(){
while(cin>>s+1) {
ne[0]=-1;
int len = strlen(s + 1);
for (int i = 2, j = 0; i <= len; i++) {
while (j && s[i] != s[j + 1]) j = ne[j];
if (s[i] == s[j + 1]) j++;
ne[i] = j;
}
int n = len-ne[len]; // 最小循环节长度
cout<<n<<endl;
if(n!=len&&len%n==0) cout<<0<<endl; //最少还需要添加几个字符使字符串有循环
else cout<<n-ne[len]%n<<endl;
}
return 0;
}