#include <bits/stdc++.h>
using namespace std;
bool IsPalindrome(string &s) {
  int i = 0;
  int j = s.size() - 1;
  while (i < j) {
    if (s[i] != s[j]) return false;
    i++;
    j--;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  map<char, int> mapping;
  int even_count = 0;
  for (auto c : s) {
    mapping[c]++;
  }
  int diff = 0;
  for (auto it = mapping.begin(); it != mapping.end(); it++) {
    if (it->second > 1) diff++;
  }
  if (diff < 2) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 0; i < s.size() / 2; i++) {
    string ms = s.substr(i + 1);
    ms.append(s.substr(0, i + 1));
    if (s != ms && IsPalindrome(ms)) {
      cout << "1" << endl;
      return 0;
    }
  }
  cout << "2" << endl;
  return 0;
}
