#include <bits/stdc++.h>
using namespace std;
bool is(string s) {
  long long int n = (long long int)s.length(), i;
  for (i = 0; i < (n / 2); i++) {
    if (s[i] != s[n - 1 - i]) {
      return false;
    }
  }
  return true;
}
void shikhar7s(long long int cas) {
  string s;
  cin >> s;
  char ch = s[0];
  long long int n = (long long int)s.length(), i, x = 1, f = 0;
  for (i = 0; i < n; i++) {
    if (((n % 2) == 0 || i != (n / 2)) && s[i] != ch) {
      f = 1;
      break;
    }
  }
  if (!f) {
    cout << "Impossible";
    return;
  }
  i = n - 1;
  f = 0;
  while (i) {
    if (!is(s.substr(0, i + 1))) {
      break;
    }
    if ((i + 1) % 2) {
      f = 1;
      break;
    }
    x *= 2;
    i = (i - 1) / 2;
  }
  if (!f) {
    cout << 1;
  } else {
    cout << 2;
  }
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  long long int cas = 1;
  while (cas <= t) {
    shikhar7s(cas);
    cas++;
  }
  return 0;
}
