#include <bits/stdc++.h>
using namespace std;
bool Check(string strng) {
  bool retrn = 0;
  int n = strng.size();
  for (int i = 0; i < strng.size() / 2; i++) {
    if (strng[i] != strng[n - 1 - i]) retrn = 1;
  }
  return !retrn;
}
string ch;
int num;
void fun() {
  bool z = 0, result = 0;
  string current = "";
  for (int i = 0; i < num / 2; ++i) {
    current += ch[i];
    if (!Check(current)) result = 1;
    if (ch[i] != ch[0]) z = 1;
  }
  bool cc = 0;
  if (!result) {
    puts("Impossible");
    exit(0);
  }
  string tmp;
  tmp = ch;
  for (int i = 0; i < num - 1; ++i) {
    ch += ch[0];
    ch.erase(ch.begin());
    if (Check(ch) && ch != tmp) cc = 1;
  }
  if (cc)
    cout << 1 << endl;
  else
    cout << 2 << endl;
}
int main() {
  cin >> ch;
  num = ch.length();
  fun();
  return 0;
}
