#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e4;
const int K = 97;
const long long MOD = 1e9 + 7;
string s, S;
long long hsh[MAXN], hshrev[MAXN], Pow[MAXN];
void build(int i, char c) {
  hsh[i] = ((c - 'a' + 1) + hsh[i - 1] * K % MOD) % MOD;
}
void buildRev(int i, char c) {
  hshrev[i] = ((c - 'a' + 1) + hshrev[i - 1] * K % MOD) % MOD;
}
long long tinh(int i, int j) {
  return (hsh[j] - hsh[i - 1] * Pow[j - i + 1] % MOD + MOD) % MOD;
}
long long tinhRev(int i, int j) {
  return (hshrev[j] - hshrev[i - 1] * Pow[j - i + 1] % MOD + MOD) % MOD;
}
signed main() {
  Pow[0] = 1;
  for (int i = 1; i < MAXN; i++) Pow[i] = Pow[i - 1] * K % MOD;
  cin >> s;
  S = s + s.substr(0, s.length() / 2);
  for (int i = 0; i < S.length(); i++) {
    build(i + 1, S[i]);
    buildRev(i + 1, S[S.length() - i - 1]);
  }
  for (int i = 1; i <= s.length() / 2; i++) {
    if (tinh(i + 1, i + s.length()) ==
        tinhRev(S.length() + 1 - i - s.length(), S.length() - i))
      if (tinh(i + 1, i + s.length()) != hsh[s.length()]) {
        cout << 1;
        goto s;
      }
  }
  for (int i = 1; i <= s.length() / 2; i++) {
    if (hsh[i] != tinhRev(S.length() + 1 - i, S.length())) {
      cout << 2;
      goto s;
    }
  }
  cout << "Impossible";
s:;
}
