#include <bits/stdc++.h>
using namespace std;
const long long BASE = 257;
const long long INVBASE[2] = {70038911, 540856036};
const int MOD[2] = {(int)1e9 + 7, (int)1e9 + 9};
bool canOne(const string& s) {
  int hlen = s.size() / 2;
  string p = s + s;
  pair<long long, long long> init_hs(0, 0);
  long long ths[2] = {1, 1};
  for (int i = hlen - 1; i >= 0; i--) {
    init_hs.first = (init_hs.first * BASE + p[i]) % MOD[0];
    init_hs.second = (init_hs.second * BASE + p[i]) % MOD[1];
  }
  for (int i = 1; i < hlen; i++) {
    ths[0] = (ths[0] * BASE) % MOD[0];
    ths[1] = (ths[1] * BASE) % MOD[1];
  }
  pair<long long, long long> hsa(init_hs), hsb(init_hs);
  for (int i = hlen, j = s.size(); j < p.size(); i++, j++) {
    hsa.first = ((((hsa.first - p[i - hlen]) * INVBASE[0]) % MOD[0] +
                  ths[0] * p[i] % MOD[0]) %
                     MOD[0] +
                 MOD[0]) %
                MOD[0];
    hsa.second = ((((hsa.second - p[i - hlen]) * INVBASE[1]) % MOD[1] +
                   ths[1] * p[i] % MOD[1]) %
                      MOD[1] +
                  MOD[1]) %
                 MOD[1];
    hsb.first =
        (((hsb.first - p[j - hlen] * ths[0]) % MOD[0] * BASE % MOD[0] + p[j]) %
             MOD[0] +
         MOD[0]) %
        MOD[0];
    hsb.second =
        (((hsb.second - p[j - hlen] * ths[1]) % MOD[1] * BASE % MOD[1] + p[j]) %
             MOD[1] +
         MOD[1]) %
        MOD[1];
    if (hsa == hsb && hsa != init_hs) {
      return true;
    }
  }
  return false;
}
bool canTwo(const string& s) {
  for (int i = 1, j = s.size() - 2; i < j; i++, j--) {
    if (s[i] != s[i - 1]) {
      return true;
    }
  }
  return false;
}
int main() {
  string s;
  while (cin >> s) {
    if (canOne(s)) {
      cout << 1 << endl;
    } else if (canTwo(s)) {
      cout << 2 << endl;
    } else {
      cout << "Impossible" << endl;
    }
  }
}
