#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline int two(int n) { return 1 << n; }
const long long mod = 1e9 + 7;
void pre() {}
int solve();
int checkPalindrome(string s) {
  int n = s.length();
  for (int i = 0; i < (n / 2); ++i) {
    if (s[i] != s[n - 1 - i]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int TC = 1;
  while (TC--) {
    solve();
  }
  return 0;
}
int solve() {
  string s;
  cin >> s;
  int n = s.length();
  if (n % 2) {
    int flag = 1;
    for (int i = 0; i < (n / 2); ++i) {
      if (s[i] != s[0]) {
        flag = 0;
      }
    }
    if (flag) {
      cout << "Impossible";
      return 0;
    }
    for (int i = (1); i <= (n); ++i) {
      string a = s.substr(i, n - i) + s.substr(0, i);
      if (checkPalindrome(a) && (a != s)) {
        cout << 1;
        return 0;
      }
    }
    cout << 2;
  } else {
    int flag = 1;
    for (int i = 0; i < (n / 2); ++i) {
      if (s[i] != s[0]) {
        flag = 0;
      }
    }
    if (flag) {
      cout << "Impossible";
      return 0;
    }
    for (int i = (1); i <= (n); ++i) {
      string a = s.substr(i, n - i) + s.substr(0, i);
      if (0)
        cout << "> "
             << "a"
             << " = " << a << '\n';
      ;
      if (checkPalindrome(a) && (s != a)) {
        cout << 1;
        return 0;
      }
    }
    cout << 2;
  }
  return 0;
}
