#include <bits/stdc++.h>
using namespace std;
const int maxm = 5e3 + 5;
char s[maxm];
char t[maxm];
int a[maxm];
int ans;
int n;
signed main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int ok = 1;
  for (int i = 1; i <= n / 2; i++) {
    if (s[i] != s[1]) {
      ok = 0;
      break;
    }
  }
  if (ok) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    int k = 0;
    for (int j = i + 1; j <= n; j++) {
      t[++k] = s[j];
    }
    for (int j = 1; j <= i; j++) {
      t[++k] = s[j];
    }
    int l = 1, r = n;
    int ok = 1;
    while (l <= r) {
      if (t[l] != t[r]) {
        ok = 0;
        break;
      }
      l++, r--;
    }
    if (!ok) continue;
    ok = 1;
    for (int j = 1; j <= n; j++) {
      if (s[j] != t[j]) {
        ok = 0;
        break;
      }
    }
    if (ok) continue;
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= n / 2; i++) {
    if (s[i] != s[1]) {
      cout << 2 << endl;
      return 0;
    }
  }
  cout << "Impossible" << endl;
  return 0;
  return 0;
}
