#include <bits/stdc++.h>
using namespace std;
string s;
int n;
bool che(int n) {
  for (int i = 0; i < (n) / 2; ++i) {
    if (s[i] != s[n - i - 1]) return 0;
  }
  return 1;
}
bool che1() {
  int len = s.length();
  if (len & 1) return 0;
  while (len) {
    len /= 2;
    if (!che(len)) {
      return 1;
    } else if (len & 1)
      return 0;
  }
  return 0;
}
bool cheim() {
  for (int i = 0; i < (n) / 2 - 1; ++i) {
    if (s[i] != s[i + 1]) return 0;
  }
  return 1;
}
bool che2() {
  for (int i = 0; i < (n - 1) / 2; ++i) {
    if (s[i] != s[s.length() - i]) return 1;
  }
  return 0;
}
int main() {
  cin >> s;
  n = s.size();
  if (cheim())
    puts("Impossible");
  else if (che1())
    puts("1");
  else if (che2())
    puts("2");
  else
    puts("Impossible");
}
