#include <bits/stdc++.h>
using namespace std;
int check(string str, int h, int n);
int ispal(string str, int a, int b);
int main() {
  string str;
  cin >> str;
  int n = str.size();
  if (n < 4) {
    cout << "Impossible";
    return 0;
  }
  int c = 0;
  map<char, int> mp;
  int h = (n + 1) / 2;
  for (int i = h; i < n; i++) {
    if (mp[str[i]] == 0) {
      c++;
      mp[str[i]]++;
    }
  }
  if (c == 1) {
    cout << "Impossible";
    return 0;
  }
  if (n % 2 != 0) {
    cout << "2";
  } else {
    cout << check(str, 0, n - 1);
  }
}
int check(string str, int h, int n) {
  int d = n - h + 1;
  if (d % 2 != 0) {
    return 2;
  }
  int k = h + (d / 2);
  int p = ispal(str, k, n);
  if (p == 0) {
    return 1;
  } else {
    return check(str, k, n);
  }
}
int ispal(string str, int a, int b) {
  while (a <= b) {
    if (str[a] != str[b]) {
      return 0;
    }
    a++;
    b--;
  }
  return 1;
}
