#include <bits/stdc++.h>
int main() {
  std::string str;
  std::cin >> str;
  int len = str.length();
  int ct = 0;
  for (int i = 0; i < len; ++i)
    if (str[i] == str[0]) ct++;
  if (ct == len || ct == len - 1) {
    std::cout << "Impossible\n";
    return 0;
  }
  auto is_palin = [](const std::string &str) -> bool {
    int len = str.length() - 1;
    for (int i = 0, j = len; i < j; i++, j--)
      if (str[i] != str[j]) return false;
    return true;
  };
  int ans = 2;
  std::string p;
  p += str[0];
  for (int i = 1; i < len; ++i) {
    std::string curr = str.substr(i) + p;
    p += str[i];
    if (curr != str && is_palin(curr)) {
      ans = 1;
      break;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}
