#include <bits/stdc++.h>
using namespace std;
char Str[5005], Extra[5005];
bool IsPossible(int N) {
  int i, limit = (N >> 1);
  for (i = 2; i <= limit; ++i) {
    if (Str[i] != Str[i - 1]) return true;
  }
  return false;
}
int FindMinimumCuts(int N) {
  int i, j, k, limit;
  for (i = 1; i < N; ++i) {
    for (j = i + 1, k = 1; j <= N; ++j, ++k) Extra[k] = Str[j];
    for (j = 1; j <= i; ++j, ++k) Extra[k] = Str[j];
    limit = (N >> 1);
    for (j = 1; j <= limit; ++j) {
      if (Extra[j] != Extra[N - j + 1]) break;
    }
    if (j == limit + 1) {
      Extra[N + 1] = '\0';
      if (strcmp(Extra + 1, Str + 1) != 0) return 1;
    }
  }
  return 2;
}
int main() {
  int N;
  scanf("%s", Str + 1);
  N = strlen(Str + 1);
  if (IsPossible(N) == false)
    puts("Impossible");
  else
    printf("%d\n", FindMinimumCuts(N));
  return 0;
}
