#include <bits/stdc++.h>
using namespace std;
int ispal(string s) {
  int n = s.length();
  int i = 0, j = n - 1;
  while (i < j) {
    if (s[i] != s[j]) return 0;
    i++, j--;
  }
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string s;
  cin >> s;
  int n = s.length();
  if (n == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (n % 2 == 1) {
    string str;
    for (int i = 1; i < n / 2; i++) {
      if (s[i] != s[i - 1]) {
        cout << "2" << endl;
        return 0;
      }
    }
    cout << "Impossible" << endl;
  } else {
    string str;
    for (int i = n / 2; i >= 1; i--) {
      str = s.substr(i) + s.substr(0, i);
      if (ispal(str) && s != str) {
        cout << "1" << endl;
        return 0;
      }
    }
    for (int i = 1; i < n / 2; i++) {
      if (s[i] != s[i - 1]) {
        cout << "2" << endl;
        return 0;
      }
    }
    cout << "Impossible" << endl;
  }
  return 0;
}
