#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  bool allSame = true;
  for (int i = 0; i < n - 1; i++)
    if (s[i] != s[i + 1]) allSame = false;
  if (allSame) {
    puts("Impossible");
    return 0;
  }
  if (n & 1) {
    bool isPossible = false;
    for (int i = 0; i < n / 2 - 1; i++)
      if (s[i] != s[i + 1]) isPossible = true;
    if (isPossible)
      puts("2");
    else
      puts("Impossible");
    return 0;
  }
  int half = n / 2;
  bool halfPalindrome = true;
  while (halfPalindrome) {
    for (int i = 0; i < half; i++)
      if (s[i] != s[half - 1 - i]) halfPalindrome = false;
    if (!halfPalindrome) {
      puts("1");
      return 0;
    }
    if (half & 1) {
      puts("2");
      return 0;
    }
    half >>= 1;
  }
  return 0;
}
