#include <bits/stdc++.h>
using namespace std;
int main() {
  string second;
  cin >> second;
  long long int len = second.length();
  if (len % 2 == 0) {
    long long int coun = 0;
    for (long long int i = 0; i < (len); ++i)
      if (second.at(i) == second.at(0)) coun++;
    if (coun == len)
      cout << "Impossible";
    else {
      string s1;
      for (long long int i = 0; i < (len); ++i) {
        s1 = second.substr(i, len) + second.substr(0, i);
        if (s1 != second) {
          string st = s1;
          reverse(s1.begin(), s1.end());
          if (s1 == st) {
            cout << 1;
            return 0;
          }
        }
      }
      cout << 2;
    }
  } else {
    long long int coun = 0;
    for (long long int i = 0; i < (len); ++i)
      if (second.at(i) == second.at(0)) coun++;
    if (coun >= len - 1)
      cout << "Impossible";
    else
      cout << 2;
  }
  return 0;
}
