#include <bits/stdc++.h>
using namespace std;
const int maxn = 300500;
unsigned long long pw[maxn], h[maxn], f[maxn], a[3], b[3];
int p[3], len[3];
char s[maxn], t[maxn];
int n;
const int P = 101;
void jud() {
  if (~n & 1) {
    for (int i = 1; i <= n; i++)
      if (s[i] != s[1]) return;
    puts("Impossible");
  } else {
    for (int i = 1; i <= n / 2; i++)
      if (s[i] != s[1]) return;
    puts("Impossible");
  }
  exit(0);
}
bool jud2() {
  for (int i = 1; i <= n; i++)
    if (t[i] != t[n - i + 1]) return 0;
  for (int i = 1; i <= n; i++)
    if (s[i] != t[i]) return 1;
  return 0;
}
int solve() {
  for (int i = 1; i <= n - 1; i++) {
    for (int j = i + 1; j <= n; j++) t[j - i] = s[j];
    for (int j = 1; j <= i; j++) t[n - i + j] = s[j];
    if (jud2()) return 1;
  }
  return 2;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  jud();
  printf("%d\n", solve());
  return 0;
}
