#include <bits/stdc++.h>
using namespace std;
string s;
int isPalin(int start, int end) {
  if (start == end) return 1;
  int i = (start + end - 1) / 2;
  while (start <= i) {
    if (s[start++] != s[end--]) return 0;
  }
  return 1;
}
int main() {
  cin >> s;
  int start = 0, end = s.length() - 1, flag = 1;
  if (isPalin(start, end)) {
    flag = ((end - start + 1) % 2 == 1) ? 2 : flag;
    end = (start + end - 1) / 2;
  }
  while (start < end) {
    if (isPalin(start, end)) {
      flag = ((end - start + 1) % 2 == 1) ? 2 : flag;
      end = (start + end - 1) / 2;
    } else {
      cout << flag << endl;
      return 0;
    }
  }
  end = ((int)s.length() - 2) / 2;
  while (start < end) {
    if (isPalin(start, end))
      end--;
    else {
      cout << flag << endl;
      return 0;
    }
  }
  cout << "Impossible\n";
}
