#include <bits/stdc++.h>
using namespace std;
bool isPalin(int l, int r, const string &s) {
  for (int i = l, j = r; i < j; i++, j--) {
    if (s[i] != s[j]) return false;
  }
  return true;
}
int main() {
  string s;
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  int ans = -1;
  for (int i = 0, j = s.size() - 1; i < j; i++, j--) {
    if (isPalin(0, i, s)) continue;
    if (i + 1 == j)
      ans = 1;
    else
      ans = 2;
  }
  if (ans == 1) return 0 & printf("%d", ans);
  int len = s.size();
  string ns;
  for (int i = 0; i < len; i++) {
    ns = s.substr(i) + s.substr(0, i);
    if (isPalin(0, len - 1, ns) && ns != s) ans = 1;
  }
  if (ans == -1)
    puts("Impossible");
  else
    printf("%d", ans);
  return 0;
}
