#include <bits/stdc++.h>
using namespace std;
long long res;
string s;
bool isPalindrome(string s) {
  for (int i = 0; i <= s.length() / 2 - 1; i++)
    if (s[i] != s[s.length() - 1 - i]) return false;
  return true;
}
bool isDifferent(string a, string b) {
  for (int i = 0; i <= a.length() - 1; i++)
    if (a[i] != b[i]) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  res = -1;
  for (int i = 1; i <= s.length(); i++) {
    string temp = s.substr(i, s.length() - i) + s.substr(0, i);
    if (isDifferent(s, temp) && isPalindrome(temp)) {
      res = 1;
      break;
    }
  }
  if (res == -1) {
    for (int i = 2; i <= s.length() / 2; i++) {
      if (isDifferent(s.substr(0, i), s.substr(s.length() - i, i))) {
        res = 2;
        break;
      }
    }
  }
  if (res == -1)
    cout << "Impossible" << endl;
  else
    cout << res << endl;
  return 0;
}
