#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12) << fixed;
}
bool isp(string &s) {
  for (int i = 0, j = s.size() - 1; i < s.size(); i++, j--) {
    if (i > j) break;
    if (s[i] != s[j]) return false;
  }
  return true;
}
void solve() {
  int n, f = 0;
  string s;
  cin >> s;
  n = s.size();
  if (n > 3) {
    for (int i = 1; i < n / 2; i++) {
      if (s[i] != s[i - 1]) f = 1;
    }
    f ^= 1;
  }
  if (n <= 3 || f)
    cout << "Impossible\n";
  else {
    if (n % 2) {
      cout << "2\n";
    } else {
      string tmp = s;
      for (int i = 0; i < n; i++) {
        char a = s[n - 1];
        s.erase(s.end() - 1);
        s.insert(s.begin(), a);
        if (isp(s) && tmp != s) {
          cout << 1 << "\n";
          return;
        }
      }
      cout << "2\n";
    }
  }
}
int main() {
  fast();
  int t = 1;
  while (t--) {
    solve();
  }
}
