#include <bits/stdc++.h>
using namespace std;
string s;
map<char, long long> m;
bool check(string x) {
  long long n = x.size();
  for (long long i = 0, j = n - 1; i <= j; ++i, --j) {
    if (x[i] != x[j]) return false;
  }
  return x != s;
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> s;
  long long n = s.size();
  for (auto c : s) m[c]++;
  auto it = m.begin();
  it++;
  if (m.size() == 1 or (m.size() == 2 and n & 1 and
                        (m.begin()->second == 1 or (it)->second == 1))) {
    cout << "Impossible" << '\n';
    exit(0);
  }
  string x = s;
  bool yes = false;
  for (long long i = 0; i < n; ++i) {
    if (check(x)) {
      yes = true;
    }
    rotate(x.begin(), x.begin() + 1, x.end());
  }
  if (yes) {
    cout << 1 << '\n';
  } else
    cout << 2 << '\n';
  return 0;
}
