#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int main() {
  cin >> s;
  n = s.length();
  set<char> ss;
  for (char c : s) ss.insert(c);
  if (ss.size() == 1) return cout << "Impossible", 0;
  for (int i = 1; i < n; ++i) {
    string k = s.substr(i, n - i) + s.substr(0, i), t = k;
    reverse(k.begin(), k.end());
    if (t == k && t != s) return cout << 1, 0;
  }
  for (int i = 1; i < n / 2; ++i) {
    if (s[i] != s[0]) return cout << 2, 0;
  }
  cout << "Impossible";
}
