#include <bits/stdc++.h>
using namespace std;
int TN = 1;
bool pro(string x) {
  int sz = x.size();
  for (int i = 0; i < sz / 2; ++i) {
    if (x[i] != x[sz - i - 1]) {
      return 0;
    }
  }
  return 1;
}
void sol() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> cl(26, 0);
  for (int i = 0; i < n; ++i) {
    ++cl[s[i] - 'a'];
  }
  for (int i = 0; i < 26; ++i) {
    if (cl[i] == n || (cl[i] == n - 1 && n % 2)) {
      cout << "Impossible";
      return;
    }
  }
  for (int i = 1; i < n; ++i) {
    string cur =
        string(s.begin() + i, s.end()) + string(s.begin(), s.begin() + i);
    if (pro(cur) && cur != s) {
      cout << 1;
      return;
    }
  }
  cout << 2;
}
int main() {
  for (int i = 0; i < TN; ++i) {
    sol();
  }
  return 0;
}
