#include <bits/stdc++.h>
using namespace std;
char s[5010];
int len;
bool ok(string s) {
  int len = s.size();
  for (int i = 0; i < len / 2; ++i)
    if (s[i] != s[len - i - 1]) return false;
  return true;
}
bool same(string str) {
  for (int i = 0; i < len; ++i)
    if (str[i] != s[i + 1]) return false;
  return true;
}
int solve() {
  len = strlen(s + 1);
  for (int i = 1; i < len; ++i) {
    string tmp = "";
    for (int j = i + 1; j <= len; ++j) tmp += s[j];
    for (int j = 1; j <= i; ++j) tmp += s[j];
    if (!same(tmp) && ok(tmp)) return 1;
  }
  for (int i = len; i > 1; --i) {
    string tmp = "";
    for (int j = i; j <= len; ++j) tmp += s[j];
    for (int j = 1; j < i; ++j) tmp += s[j];
    if (!same(tmp) && ok(tmp)) return 1;
  }
  string tmp = "";
  for (int i = 1; i <= len / 2; ++i) {
    tmp += s[i];
    if (!ok(tmp)) return 2;
  }
  return -1;
}
int main() {
  while (scanf("%s", s + 1) != EOF) {
    int res = solve();
    if (res != -1)
      cout << res << endl;
    else
      cout << "Impossible" << endl;
  }
  return 0;
}
