#include <bits/stdc++.h>
using namespace std;
string second;
bool isPalindrome(const string& second) {
  for (int i = 0; i < second.length(); ++i) {
    if (second[i] != second[second.length() - i - 1]) return false;
  }
  return true;
}
bool solve() {
  string t = second;
  for (int i = 0; i < second.length(); ++i) {
    t = t.back() + t;
    t.pop_back();
    if (second != t && isPalindrome(t)) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> second;
  int l = 1;
  while (l < second.size() / 2) {
    if (second[l] != second[l - 1]) {
      if (solve()) {
        cout << "1\n";
        return 0;
      } else {
        cout << 2 << endl;
        return 0;
      }
    }
    l++;
  }
  cout << "Impossible";
  return 0;
}
