//vi good_pref(string s){
//    vi z = z_alg(s);
//    vi good_pref(sz(s)+1);
//    rep(jump,1,sz(s)/2)
//        for(int start = jump; start+jump <= sz(s); start += jump)
//            if(z[start] >= jump)
//                good_pref[start+jump] = true;
//            else
//                break;
//    return good_pref;
//}
//void __(){
//    _(string,s);
//    vi a = good_pref(s);
//    reverse(all(s));
//    vi b = good_pref(s);
//    if(!a[sz(s)]){
//        print_n 1,1;
//    }else if(count(all(s),s[0]) == sz(s)){
//        print_n sz(s),1;
//    }else{
//        int ans = 0;
//        rep(i,1,sz(s)-1)
//            if(!a[i] && !b[sz(s)-i])
//                ++ans;
//        print_n 2,ans;
//    }
//}
//
//
#include <iomanip>
#include <algorithm>
#include <vector>
#include <utility>
#include <iostream>
#include <string>
#define REP_INT(i,l,r) for(int i = l; i <= r; ++i)
#define GET_REP_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define rep(...) GET_REP_MACRO(__VA_ARGS__,REP_ANY,REP_INT,REP_ZERO_INT)(__VA_ARGS__)
#define all(v) (v).begin(), (v).end()
#define sz(v) ll(v.size())
#define T1 template<typename T> static
using namespace std;
typedef long long ll;
typedef vector<int> vi;
T1 ostream& operator<<(ostream& stream, const vector<T>& t);
T1 istream& read(T, T, istream& = cin);
T1 vector<int> z_alg(vector<T>& s){
    vector<int> z(sz(s));
    int n = sz(s);
    int L = 0, R = 0;
    for(int i = 1; i < n; i++){
        if(i > R){
            L = R = i;
            while(R < n && s[R - L] == s[R])
                R++;
            z[i] = R - L;
            R--;
        }else{
            int k = i - L;
            if(z[k] < R - i + 1)
                z[i] = z[k];
            else{
                L = i;
                while(R < n && s[R - L] == s[R])
                    R++;
                z[i] = R - L;
                R--;
            }
        }
    }
    z[0] = sz(s);
    return z;
}
static vector<int> z_alg(string s){
    vector<char> t(all(s));
    return z_alg(t);
}
struct _print {
    string sep,end;
    bool space;
    ostream &stream;
    _print(string _sep=" ",string _end="\n",
            ostream &_stream = cout)
        : sep(_sep),end(_end),space(false),
            stream(_stream) {}
    ~_print() { stream << end; }
    template <typename T>
        _print &operator , (const T &t) {
            if (space) stream << sep;
            space = true;
            stream << t;
            return *this;
        }
};
#define print_n _print("\n"),
#define INPUT_WITHOUT_INIT(type,name) type name; cin >> name
#define GET_INPUT_MACRO(_1,_2,_3,_4,_5,_6,_7,_8,NAME,...) NAME
#define _(...) GET_INPUT_MACRO(__VA_ARGS__,_IWI,_IWI,_IWI,_IWI,_IWI,_IWI,INPUT_WITHOUT_INIT)(__VA_ARGS__)
vi good_pref(string s){
    vi z = z_alg(s);
    vi good_pref(sz(s)+1);
    rep(jump,1,sz(s)/2)
        for(int start = jump; start+jump <= sz(s); start += jump)
            if(z[start] >= jump)
                good_pref[start+jump] = true;
            else
                break;
    return good_pref;
}
void __(){
    _(string,s);
    vi a = good_pref(s);
    reverse(all(s));
    vi b = good_pref(s);
    if(!a[sz(s)]){
        print_n 1,1;
    }else if(count(all(s),s[0]) == sz(s)){
        print_n sz(s),1;
    }else{
        int ans = 0;
        rep(i,1,sz(s)-1)
            if(!a[i] && !b[sz(s)-i])
                ++ans;
        print_n 2,ans;
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
        __();
}


Measured memory_bytes: 8108