#include <bits/stdc++.h>
using namespace std;
bool isPalin(string &s) {
  int i = 0, j = (int)s.size() - 1;
  while (i < j) {
    if (s[i++] != s[j--]) return false;
  }
  return true;
}
bool possible1(string &s) {
  string temp = s;
  for (int i = 0; i < s.size(); i++) {
    temp = temp.back() + temp;
    temp.pop_back();
    if (isPalin(temp) && temp != s) return true;
  }
  return false;
}
bool isPossible(string &s) {
  int diff = 0;
  for (int i = 1; i < s.size(); i++) {
    if (s[i] != s[0]) diff++;
  }
  return diff > 1;
}
int main() {
  string inp;
  cin >> inp;
  if (!isPossible(inp)) {
    cout << "Impossible" << endl;
    return 0;
  }
  if (possible1(inp))
    printf("1");
  else
    printf("2");
  return 0;
}
