#include <bits/stdc++.h>
using namespace std;
bool isPalinedrome(string s) {
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] != s[s.length() - i - 1]) return false;
  }
  return true;
}
bool solver(string s) {
  string t = s;
  for (int i = 0; i < t.length(); i++) {
    t = t[t.length() - 1] + t;
    t.erase(t.end() - 1);
    if (s != t && isPalinedrome(t)) {
      return true;
    }
  }
  return false;
}
bool anyAnswer(string s) {
  int t = 0;
  for (int i = 0; i < s.length(); ++i) {
    t += s[i] != s[0];
  }
  return t > 1;
}
int main() {
  string s;
  cin >> s;
  if (anyAnswer(s)) {
    cout << (solver(s) ? 1 : 2) << endl;
  } else {
    cout << "Impossible" << endl;
  }
  return 0;
}
