#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int n, m, ans, cnt;
char s[maxn], w[maxn];
bool judge() {
  for (int i = 2; i <= n / 2; i++) {
    if (s[i] != s[i - 1]) return true;
  }
  return false;
}
bool judge1() {
  for (int i = 1; i <= n / 2; i++) {
    if (w[i] != w[n - i + 1]) return false;
  }
  return true;
}
bool judge4() {
  for (int i = 1; i <= n; i++) {
    if (s[i] != w[i]) return true;
  }
  return false;
}
bool judge2() {
  for (int i = 2; i <= n / 2; i++) {
    {
      for (int j = 1; j <= n; j++) w[j] = s[j];
      for (int j = 1; j <= i; j++) w[j + n] = w[j];
      for (int j = i + 1; j <= n + i; j++) w[j - i] = w[j];
      if (!judge4()) continue;
      if (judge1()) return true;
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  scanf("%s", s + 1);
  n = strlen(s + 1);
  if (!judge() || n <= 3) {
    puts("Impossible");
    return 0;
  }
  if (judge2())
    ans = 1;
  else
    ans = 2;
  cout << ans << endl;
  return 0;
}
