#include <bits/stdc++.h>
using namespace std;

bool isPalindrome(const string& s) {
    for(int i = 0; i < s.length(); ++i) {
        if (s[i] != s[s.length() - i - 1]) 
            return false;
    }
    return true;
}

bool solve1(string s) {
    string t = s;
    for(int i = 0; i < s.length(); ++i) {
        t = t.back() + t;
        t.pop_back();
        if (s != t && isPalindrome(t)) {
            return true;
        }
    }
    return false;
}

bool anyAnswer(const string& s) {
    int nt = 0;
    for(int i = 0; i < s.length(); ++i) {
        nt += s[i] != s[0];
    }
    return nt > 1;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);

    string s;
    cin >> s;
    if (anyAnswer(s)) {
        cout << (solve1(s) ? 1 : 2) << endl;
    } else {
        cout << "Impossible" << endl;
    }

    return 0;
}
