#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool is_palindrom(string s) {
  for (long long i = 0; 2 * i < s.size(); i++) {
    if (s[i] != s[s.size() - i - 1]) {
      return false;
    }
  }
  return true;
}
long long f(string s) {
  if (s.size() < 2) return -1;
  string s1 = "";
  for (long long i = 0; i * 2 + 1 < s.size(); i++) s1 += s[i];
  if (!is_palindrom(s1)) {
    return 1 + s.size() % 2;
  } else {
    long long k = f(s1);
    if (k == 1) return 1;
    s1 = "";
    for (long long i = 0; 2 * i + 1 < s.size(); i++) {
      s1 += s[i];
      if (!is_palindrom(s1)) return 2;
    }
    if (k == -1) return -1;
    return k + 2 * (s.size() % 2);
  }
}
int32_t main() {
  string s;
  cin >> s;
  long long k = f(s);
  if (k == -1)
    cout << "Impossible" << endl;
  else
    cout << k << endl;
  return 0;
}
