#include <bits/stdc++.h>
using namespace std;
void fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
bool ispallindrome(string &s, long long i, long long n) {
  long long j = n - 1;
  while (i < j) {
    if (s[i] != s[j]) {
      return (0);
    }
    i++;
    j--;
  }
  return (1);
}
int main() {
  fastio();
  string s;
  cin >> s;
  long long i, j;
  long long c[26] = {0};
  for (i = 0; i < s.length(); i++) {
    c[s[i] - 'a']++;
  }
  long long p = 0;
  long long n = s.length();
  for (i = 0; i < 26; i++) {
    if (c[i] > 0) {
      p++;
    }
  }
  if (p == 1) {
    cout << "Impossible"
         << "\n";
  } else {
    if (n % 2 == 1) {
      for (i = 0; i < n / 2; i++) {
        if (s[i] != s[0]) {
          break;
        }
      }
      if (i == n / 2) {
        cout << "Impossible"
             << "\n";
      } else {
        cout << 2 << "\n";
      }
    } else {
      long long cur = n / 2;
      bool f = 0;
      while (cur > 1) {
        if (!ispallindrome(s, 0, cur)) {
          f = 1;
          break;
        }
        if (cur % 2 == 0) {
          cur = cur / 2;
        } else {
          break;
        }
      }
      if (f) {
        cout << 1 << "\n";
      } else {
        cout << 2 << "\n";
      }
    }
  }
}
