#include <bits/stdc++.h>
using namespace std;
long long check(string second) {
  string t = second;
  reverse(second.begin(), second.end());
  return t == second;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  clock_t startTime = clock();
  long long T = 1;
  while (T--) {
    string second;
    cin >> second;
    long long ans = 1;
    if (second.length() & 1) ans = 2;
    second = second.substr(0, second.length() / 2);
    while (second.length() > 1 && check(second)) {
      if (second.length() & 1) ans = 2;
      second = second.substr(0, (second.length() + 1) / 2);
    }
    if (second.length() <= 1)
      cout << "Impossible";
    else
      cout << ans;
  }
}
