#include <bits/stdc++.h>
using namespace std;
bool check(string a, string b) {
  if (a == b) return false;
  assert(a.size() == b.size());
  for (long long i = 0; i < a.size() / 2; i++)
    if (a[i] != a[a.size() - i - 1]) return false;
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string second;
  cin >> second;
  long long n = second.size();
  long long ans = 3;
  string a, b;
  for (long long i = 0; i < n / 2; i++) {
    a.push_back(second[i]);
    b.push_back(second[n - i - 1]);
    string c;
    for (long long j = i + 1; j < n - i - 1; j++) c.push_back(second[j]);
    reverse(b.begin(), b.end());
    string d = b + c + a;
    if (check(d, second)) ans = 2;
  }
  a.clear();
  for (long long i = n - 1; i > 0; i--) {
    a.push_back(second[i]);
    string c;
    for (long long j = 0; j < i; j++) c.push_back(second[j]);
    string b = a;
    reverse(b.begin(), b.end());
    string d = b + c;
    if (check(d, second)) ans = 1;
  }
  if (ans == 3)
    cout << "Impossible\n";
  else
    cout << ans;
  return 0;
}
