#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using dbl = double;
void solve() {
  string s;
  cin >> s;
  for (int i = 0; i + 1 < (int)s.size(); ++i) {
    auto t = s.substr(i + 1) + s.substr(0, i + 1);
    if (t == s) continue;
    bool ok = true;
    for (int j = 0; j < (int)t.size(); ++j) ok &= t[j] == t[t.size() - 1 - j];
    if (ok) {
      cout << 1 << endl;
      return;
    }
  }
  int id = 1;
  while (id < (int)s.size() && s[id] == s[id - 1]) ++id;
  if (id == (int)s.size() || 2 * id + 1 == (int)s.size()) {
    cout << "Impossible" << endl;
  } else {
    cout << 2 << endl;
  }
}
int main() {
  int test_count = 1;
  for (int i = 0; i < test_count; ++i) {
    solve();
  }
  (void)0;
}
