#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long binpow(long long base, long long exp, int mod) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % mod;
    exp = exp >> 1;
    base = (base * base) % mod;
  }
  return res;
}
long long mod(long long x) {
  return ((x % 1000000007LL + 1000000007LL) % 1000000007LL);
}
long long add(long long a, long long b) { return mod(mod(a) + mod(b)); }
long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  string s;
  cin >> s;
  long long int n = s.length();
  long long int value = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] != s[0]) {
      value++;
    }
  }
  if (value > 1 && n >= 4) {
    bool check = false;
    for (int i = 0; i < n - 1; i++) {
      bool temp1 = true, temp2 = false;
      long long int q1 = i, q2 = i + 1;
      for (int r = 0; r < n / 2; r++) {
        if (s[q1] != s[q2]) {
          temp1 = false;
          break;
        } else {
          q1--;
          q2++;
          q1 = (q1 + n) % n;
          q2 = (q2 + n) % n;
        }
      }
      q2 = i + 1;
      for (int r = 0; r < n; r++) {
        if (s[q2] != s[r]) {
          temp2 = true;
          break;
        } else {
          q2++;
          q2 = (q2 + n) % n;
        }
      }
      check = check | (temp1 & temp2);
    }
    if (check) {
      cout << "1"
           << "\n";
    } else {
      cout << "2"
           << "\n";
    }
  } else {
    cout << "Impossible"
         << "\n";
  }
  return 0;
}
