#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 10;
const int mod = 1e9 + 7;
int n;
char s[N];
int a[30];
int main() {
  scanf("%s", s);
  int len = strlen(s);
  int cnt = 0;
  for (int i = 0; i < len; i++) {
    if (a[s[i] - 'a'] == 0) cnt++;
    a[s[i] - 'a']++;
  }
  if (cnt == 1)
    printf("Impossible\n");
  else {
    if (cnt == 2 && a[s[len / 2] - 'a'] == 1)
      printf("Impossible\n");
    else {
      int flag = 0;
      string ss;
      for (int i = 1; i < len; i++) {
        ss = "";
        int f = 0;
        for (int j = i; j < len; j++) ss += s[j];
        for (int j = 0; j < i; j++) ss += s[j];
        if (ss == s) continue;
        for (int j = 0; j <= len / 2; j++)
          if (ss[j] != ss[len - 1 - j]) f = -1;
        if (f == 0) {
          flag++;
          break;
        }
      }
      if (flag > 0)
        printf("1\n");
      else
        printf("2\n");
    }
  }
}
