#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long n = s.size();
  map<long long, long long> h;
  for (auto &x : s) h[x] += 1;
  long long ans = 0;
  for (auto &x : h)
    if (x.second >= 2) ans += 1;
  if (ans >= 2) {
    string t = s, tmp;
    string rt = s;
    for (long long i = 0; i + 1 < n; i++) {
      t = t.back() + t;
      t.pop_back();
      rt = t;
      reverse(rt.begin(), rt.end());
      if (rt == t && t != s) {
        cout << 1;
        return 0;
      }
    }
    string a = s, b = s, m = s;
    string t1 = "", t2 = "", t3 = "";
    reverse(b.begin(), b.end());
    t = "", rt = "";
    for (long long i = 0; i < n / 2; i++) {
      t1 += a.back();
      t3 = b.back() + t3;
      a.pop_back();
      b.pop_back();
      m.pop_back();
      t2 = "";
      for (long long j = i + 1; j < m.size(); j++) t2 += m[j];
      t = t3 + t2 + t1;
      rt = t;
      reverse(rt.begin(), rt.end());
      if (rt == t && t != s) {
        cout << 2;
        return 0;
      }
    }
  } else
    cout << "Impossible";
}
