#include <bits/stdc++.h>
using namespace std;
void solve(long long tz) {
  string s;
  cin >> s;
  map<int, int> mp;
  for (int i = 0; i < s.length(); i++) {
    mp[s[i]]++;
  }
  if (mp.size() == 1) {
    cout << "Impossible" << endl;
    return;
  }
  if (mp.size() == 2) {
    auto it = mp.begin();
    bool find = false;
    if (it->second == 1) {
      find = true;
    }
    it++;
    if (it->second == 1) {
      find = true;
    }
    if (find) {
      cout << "Impossible" << endl;
      return;
    }
  }
  string curr;
  string p = s;
  while (p.length() > 0) {
    curr += p[0];
    p.erase(p.begin() + 0);
    string num = p + curr;
    bool find = true;
    for (int i = 0, j = num.length() - 1; i < j; i++, j--) {
      if (num[i] != num[j]) {
        find = false;
        break;
      }
    }
    if (find && num != s) {
      cout << 1 << endl;
      return;
    }
  }
  string q = s;
  curr = "";
  while (q.length() > 0) {
    curr += q[q.length() - 1];
    q.erase(q.begin() + q.length() - 1);
    string num = q + curr;
    bool find = true;
    for (int i = 0, j = num.length() - 1; i < j; i++, j--) {
      if (num[i] != num[j]) {
        find = false;
        break;
      }
    }
    if (find && num != s) {
      cout << 1 << endl;
      return;
    }
  }
  cout << 2 << endl;
  return;
}
int main() {
  long long t;
  t = 1;
  long long z = 0;
  while (t--) {
    z++;
    solve(z);
  }
}
