#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<int> freq(26, 0);
  for (int i = 0; i < s.size(); i++) {
    freq[s[i] - 'a']++;
  }
  int freq_c = 0;
  int odd = 0;
  for (int i = 0; i < 26; i++) {
    if (freq[i]) {
      freq_c++;
    }
    if (freq[i] % 2) {
      if (freq[i] == 1) {
        odd = 1;
      }
    }
  }
  if (odd && freq_c == 2) {
    cout << "Impossible";
    return 0;
  }
  if (freq_c == 1) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 1; i < s.size() - 1; i++) {
    string new_string = s.substr(i) + s.substr(0, i);
    string rev_string = new_string;
    reverse(new_string.begin(), new_string.end());
    if (new_string == s) {
      continue;
    }
    if (new_string == rev_string) {
      cout << 1;
      return 0;
    }
  }
  cout << 2;
}
