#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 5;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e = exp(1);
const double PI = acos(-1);
const double ERR = 1e-10;
char input[maxn], temp[maxn];
int main() {
  scanf("%s", input);
  int n = strlen(input);
  bool isok = false;
  for (int i = 1; i < n / 2; i++) {
    if (input[i] != input[i - 1]) {
      isok = true;
      break;
    }
  }
  if (!isok) {
    printf("Impossible\n");
    return 0;
  }
  bool ispa = true;
  for (int i = 0; i < n / 4; i++) {
    if (input[i] != input[n / 2 - 1 - i]) {
      ispa = false;
      break;
    }
  }
  int answer;
  if (n & 1)
    answer = 2;
  else
    answer = ispa ? 2 : 1;
  for (int i = 0; i < n - 1; i++) {
    int pos = 0;
    for (int j = i + 1; j < n; j++) temp[pos++] = input[j];
    for (int j = 0; j < i + 1; j++) temp[pos++] = input[j];
    temp[pos] = 0;
    bool isfail = false;
    bool isfail2 = true;
    for (int j = 0; j < n / 2; j++) {
      if (temp[j] != temp[n - j - 1]) {
        isfail = true;
        break;
      }
      if (temp[j] != input[j]) isfail2 = false;
    }
    if (!isfail && !isfail2) {
      answer = 1;
      break;
    }
  }
  printf("%d\n", answer);
  return 0;
}
