#include <bits/stdc++.h>
using namespace std;
bool chek(string s) {
  for (int i = 0; i < s.size() / 2; i++) {
    string s1 = "";
    for (int j = i + 1; j < s.size(); j++) s1 += s[j];
    for (int j = 0; j <= i; j++) s1 += s[j];
    bool p1 = 1, p2 = 0;
    for (int j = 0; j < s.size() / 2; j++) {
      if (s1[j] != s1[s.size() - j - 1]) p1 = 0;
    }
    for (int j = 0; j < s.size(); j++) {
      if (s1[j] != s[j]) p2 = 1;
    }
    if (p1 && p2) return 1;
  }
  return 0;
}
int main() {
  string s;
  cin >> s;
  bool ans = 0;
  for (int i = 0; i < s.size() / 2; i++) {
    if (s[i] != s[0]) {
      ans = 1;
    }
  }
  if (!ans)
    cout << "Impossible";
  else {
    if (chek(s))
      cout << 1;
    else
      cout << 2;
  }
  return 0;
}
