#include <bits/stdc++.h>
using namespace std;
template <class T>
void dbs(string str, T t) {
  cerr << str << " : " << t << "\n";
}
template <class T, class... S>
void dbs(string str, T t, S... s) {
  int idx = str.find(',');
  cerr << str.substr(0, idx) << " : " << t << ", ";
  dbs(str.substr(idx + 1), s...);
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class S, class T>
ostream& operator<<(ostream& os, const map<S, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
void prc(T a, T b) {
  cerr << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cerr << ", ";
    cerr << *i;
  }
  cerr << "]\n";
}
bool isPal(string s) {
  int i = 0, j = s.size() - 1;
  while (i < j) {
    if (s[i] != s[j]) return 0;
    i++;
    j--;
  }
  return 1;
}
void code() {
  int i, j, k, n, q, b, x;
  string s;
  cin >> s;
  n = s.size();
  for (i = 1; i < n; i++) {
    string s1 = s.substr(i, n - i) + s.substr(0, i);
    if (s == s1) continue;
    if (isPal(s1)) {
      cout << 1;
      return;
    }
  }
  for (i = 1; i < n / 2; i++) {
    if (s[i] != s[i - 1]) {
      cout << 2;
      return;
    }
  }
  cout << "Impossible";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tt, t = 1;
  for (tt = 1; tt <= t; tt++) {
    code();
  }
  return 0;
}
