#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline int add(int a, int b);
inline int mult(int a, int b);
inline int sub(int a, int b);
inline int divv(int a, int b);
int p1[300500];
int p2[300500];
int pow1 = 37;
int pow2 = 41;
int mod1 = 1000000007;
int mod2 = 1000000009;
int32_t main() {
  std::iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  string s;
  cin >> s;
  int half = s.size() / 2;
  set<char> st;
  for (int i = 0; i < half; i++) st.insert(s[i]);
  if (st.size() <= 1) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i < s.size(); i++) {
    string s1 = s.substr(0, i);
    string s2 = s.substr(i, s.size());
    string t = s2 + s1;
    string rt = t;
    reverse(rt.begin(), rt.end());
    if (t != s && t == rt) {
      cout << "1\n";
      return 0;
    }
  }
  cout << "2\n";
  return 0;
}
int add(int a, int b) {
  int result = a + b;
  if (result >= mod) result -= mod;
  return result;
}
int sub(int a, int b) {
  int result = a - b;
  if (result < 0) result += mod;
  return result;
}
int mult(int a, int b) { return (a * 1ll * b) % mod; }
int bin(int a, int n) {
  int res = 1;
  while (n) {
    if (n & 1) res = mult(res, a);
    a = mult(a, a);
    n /= 2;
  }
  return res;
}
int divv(int a, int b) { return mult(a, bin(b, mod - 2)); }
