#include <bits/stdc++.h>
using namespace std;
string s;
bool check(long long l, long long r) {
  for (long long i = l; i < (r + l) / 2; i++) {
    if (s[i] != s[r - i - 1]) {
      return false;
    }
  }
  return true;
}
long long sulganlox(long long l, long long r) {
  if (r - l == 1) {
    if (s[l] == s[l + 1]) {
      cout << "Impossible" << endl;
      exit(0);
    }
    return 2;
  }
  if ((r - l) % 2 == 0) {
    if (check(l, (r + l) / 2)) {
      return sulganlox(l, (r + l) / 2);
    } else {
      return 1;
    }
  } else {
    if (check(l, (r + l) / 2)) {
      return sulganlox(l, (r + l) / 2);
    } else {
      return 2;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  long long n = s.size();
  if (n == 1) {
    cout << "Impossible" << endl;
    return 0;
  }
  cout << sulganlox(0, n) << endl;
  return 0;
}
