#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  cin >> s;
  long long k = 1, n = s.size();
  for (long long i = 1; i < n; i++) {
    if (s[i] == s[0]) {
      k += 1;
    }
  }
  if ((n % 2 != 0 and k == n - 1) or k == n) {
    cout << "Impossible";
    return 0;
  }
  string t = s;
  long long fl = 0;
  for (long long i = 0; i < n - 1; i++) {
    char c = t[n - 1];
    t = c + t;
    t.erase(t.end() - 1);
    long long fla = 0;
    for (long long i = 0; i < n / 2; i++) {
      if (t[i] != t[n - i - 1]) {
        fla = 1;
        break;
      }
    }
    if (t != s and fla == 0) {
      fl = 1;
      break;
    }
  }
  if (fl == 1) {
    cout << 1;
  } else {
    cout << 2;
  }
}
