#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;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpib29sIGlzUGFsaW5kcm9tZShjb25zdCBzdHJpbmcmIHMpIHsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzLmxlbmd0aCgpOyArK2kpIHsKICAgICAgICBpZiAoc1tpXSAhPSBzW3MubGVuZ3RoKCkgLSBpIC0gMV0pIAogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQoKYm9vbCBzb2x2ZTEoc3RyaW5nIHMpIHsKICAgIHN0cmluZyB0ID0gczsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzLmxlbmd0aCgpOyArK2kpIHsKICAgICAgICB0ID0gdC5iYWNrKCkgKyB0OwogICAgICAgIHQucG9wX2JhY2soKTsKICAgICAgICBpZiAocyAhPSB0ICYmIGlzUGFsaW5kcm9tZSh0KSkgewogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9CiAgICB9CiAgICByZXR1cm4gZmFsc2U7Cn0KCmJvb2wgYW55QW5zd2VyKGNvbnN0IHN0cmluZyYgcykgewogICAgaW50IG50ID0gMDsKICAgIGZvcihpbnQgaSA9IDA7IGkgP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