#include <bits/stdc++.h>
using namespace std;
bool isPalindrome(const string &s) {
  for (int i = 0; i <= (int)s.size() - 1; i += 1)
    if (s[i] != s[(int)s.size() - i - 1]) return 0;
  return 1;
}
bool solve1(string s) {
  string t = s;
  for (int i = 0; i <= (int)s.size() - 1; i += 1) {
    t = t.back() + t, t.pop_back();
    if (s != t && isPalindrome(t)) return 1;
  }
  return 0;
}
bool anyAnswer(const string &s) {
  int nt = 0;
  for (int i = 0; i <= (int)s.size() - 1; i += 1) nt += s[i] != s[0];
  return nt > 1;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  string s;
  cin >> s;
  if (anyAnswer(s))
    cout << (solve1(s) ? 1 : 2);
  else
    cout << "Impossible";
  return 0;
}
