#include <bits/stdc++.h>
using namespace std;
string s;
bool Check(const string& s) {
  int cnt = 0;
  for (int i = 0; i < (int)s.length(); i++) cnt += (s[i] != s[0]);
  if (cnt > 1) return true;
  return false;
}
bool Palin(const string& s) {
  for (int i = 0; i < (int)s.length(); i++)
    if (s[i] != s[(int)s.length() - i - 1]) return false;
  return true;
}
bool Solve(string s) {
  string t = s;
  for (int i = 0; i < (int)s.length(); i++) {
    t = t.back() + t;
    t.pop_back();
    if (s != t && Palin(t)) return true;
  }
  return false;
}
int main() {
  cin >> s;
  if (Check(s)) {
    if (Solve(s))
      cout << 1;
    else
      cout << 2;
  } else
    cout << "Impossible";
}
