#include <bits/stdc++.h>
using namespace std;
const long long int INF = (long long int)(8e18);
const long long int MOD = 1000000007;
long long int freq[27];
long long int check(string s) {
  long long int n = s.length();
  for (long long int i = 1; i < n; i++) {
    string a = s.substr(0, i);
    string b = s.substr(i, n - i);
    string c = b + a;
    string d = c;
    reverse(c.begin(), c.end());
    if (c == d && c != s) {
      cout << 1 << '\n';
      exit(0);
    }
  }
}
void print() {
  cout << "Impossible" << '\n';
  exit(0);
}
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  if (s.length() == 1) print();
  check(s);
  for (int i = 0; i < s.length(); i++) freq[s[i] - 'a']++;
  long long int val = 0;
  for (int i = 0; i < 27; i++) {
    if (freq[i] > 0) val++;
  }
  if (val == 1) print();
  memset(freq, 0, sizeof freq);
  for (long long int i = 0; i < s.length() / 2; i++) {
    freq[s[i] - 'a']++;
    val = 0;
    for (int j = 0; j < 27; j++) {
      if (freq[j] > 0) val++;
    }
    if (val > 1) {
      cout << 2 << '\n';
      return 0;
    }
  }
  print();
  return 0;
}
