#include <bits/stdc++.h>
using namespace std;
bool all_equal_maybe_except_center(string &s) {
  for (int i = 1; i < s.size(); ++i) {
    if (s.size() % 2 == 1 && i == s.size() / 2) {
      continue;
    }
    if (s[i] != s[0]) {
      return false;
    }
  }
  return true;
}
bool ispalindrome(string &s) {
  for (int i = 0; i <= s.size() / 2; ++i) {
    if (s[i] != s[s.size() - 1 - i]) {
      return false;
    }
  }
  return true;
}
bool cyclic(string &s) {
  int n = s.size();
  string s1, s2, s3;
  for (int i = 1; i < n; ++i) {
    s1 = s.substr(0, i);
    s2 = s.substr(i);
    s3 = s2 + s1;
    if (s != s3 && ispalindrome(s3)) {
      return true;
    }
  }
  return false;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  if (all_equal_maybe_except_center(s)) {
    cout << "Impossible";
    return 0;
  }
  if (cyclic(s)) {
    cout << "1";
    return 0;
  }
  cout << "2";
  return 0;
}
