#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
using vll = V<ll>;
using vii = V<int>;
using vvll = V<vll>;
using vvii = V<V<int> >;
using PII = P<int, int>;
using PLL = P<ll, ll>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class A, class B>
ostream& operator<<(ostream& out, const P<A, B>& p) {
  return out << '(' << p.first << ", " << p.second << ')';
}
template <class A>
ostream& operator<<(ostream& out, const V<A>& v) {
  out << '[';
  for (int i = 0; i < int(v.size()); i++) {
    if (i) out << ", ";
    out << v[i];
  }
  return out << ']';
}
const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = int(s.size());
  {
    int cntc = 1;
    for (ll i = 1; i < n; i++) cntc += (s[i] == s[0]);
    if (cntc == n or cntc == n - 1) {
      cout << "Impossible\n";
      return 0;
    }
  }
  auto ispalin = [&](const string& t) -> bool {
    bool ret = true;
    for (ll i = 0; i < int(t.size()); i++) {
      ret = ret and (t[i] == t[int(t.size()) - i - 1]);
    }
    return ret;
  };
  int ans = INF;
  {
    for (ll i = 0; i < n / 2; i++) {
      string t;
      for (ll j = n - i - 1; j < n; j++) t.push_back(s[j]);
      for (ll j = i + 1; j < n - i - 1; j++) t.push_back(s[j]);
      for (ll j = 0; j < i + 1; j++) t.push_back(s[j]);
      if (t != s and ispalin(t)) ans = 2;
    }
  }
  {
    for (ll i = 1; i < n; i++) {
      string t;
      for (ll j = i; j < n; j++) t.push_back(s[j]);
      for (ll j = 0; j < i; j++) t.push_back(s[j]);
      if (t != s and ispalin(t)) ans = 1;
    }
  }
  if (ans == INF)
    cout << "Impossible\n";
  else
    cout << ans << '\n';
  return 0;
}
