#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
bool is_palin(string &s) {
  int n = ((int)(s).size());
  for (int i = 0; i < (n + 1) / 2; i++) {
    if (s[i] != s[n - i - 1]) return 0;
  }
  return 1;
}
void solve() {
  string s;
  cin >> s;
  int n = ((int)(s).size()), ans = -1;
  char ch = s[0];
  for (int i = 1; i < (n + 1) / 2; i++) {
    if (s[i] != ch) {
      if (i == (n + 1) / 2 - 1) {
        if (n % 2)
          break;
        else
          ans = 1;
      } else
        ans = 2;
      break;
    }
  }
  for (int i = 1; i < n; i++) {
    string p = s.substr(i);
    p += s.substr(0, i);
    if (is_palin(p) and p != s) {
      ans = 1;
      break;
    }
  }
  if (ans != -1)
    cout << ans;
  else
    cout << "Impossible";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
