#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
const long long maxnodes = 1005;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long n = s.length();
  long long ch = 0;
  vector<long long> f(26, 0);
  for (long long i = 0; i < n; i++) {
    f[s[i] - 'a']++;
  }
  bool k = 0;
  for (long long i = 0; i < 26; i++) {
    if (f[i]) ch++;
    if (f[i] == 1) k = 1;
  }
  if (ch == 1) {
    cout << "Impossible";
    return 0;
  }
  if (ch == 2 and k == 1) {
    cout << "Impossible";
    return 0;
  }
  string t = s;
  t += s;
  for (long long i = 1; i < n; i++) {
    long long c = 0;
    ch = 1;
    bool z = 1;
    for (long long j = i; j < i + n; j++) {
      if (t[j] != s[c]) z = 0;
      if (t[j] == t[i + n - 1 - c])
        ;
      else
        ch = 0;
      c++;
    }
    if (ch and z == 0) {
      cerr << i;
      cout << 1;
      return 0;
    }
  }
  cout << 2;
  return 0;
}
