#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); ++i) {
    string f = "", ss = "";
    for (int j = 0; j <= i; ++j) f += s[j];
    for (int j = i + 1; j < s.size(); ++j) ss += s[j];
    string ans = ss + f;
    bool fl = 0;
    for (int j = 0; j < ans.size(); ++j) {
      if (ans[j] != ans[ans.size() - j - 1]) {
        fl = 1;
        break;
      }
    }
    if (fl)
      continue;
    else if (s != ans) {
      cout << 1;
      return 0;
    }
  }
  set<char> c;
  for (int i = 0; i < s.size() / 2; ++i) c.insert(s[i]);
  if (c.size() < 2)
    cout << "Impossible";
  else
    cout << 2;
  return 0;
}
