#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long qmul(long long a, long long b, long long m) {
  long long res = 0;
  while (b) {
    if (b & 1) res = (res + a) % m;
    a = (a << 1) % m;
    b = b >> 1;
  }
  return res;
}
inline long long qpow(long long a, long long b, long long m) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % m;
    a = (a * a) % m;
    b = b >> 1;
  }
  return res;
}
inline long long inv(long long x, long long q) { return qpow(x, q - 2, q); }
using namespace std;
const int N = 1e6 + 10;
const int M = 1000000007;
const double eps = 1e5;
string ss;
string s;
string t;
int len[N];
bool del[N];
int n;
void mana() {
  s.push_back('$');
  s.push_back('#');
  for (int i = 0; ss[i]; i++) {
    s.push_back(ss[i]);
    s.push_back('#');
  }
  int a = 1, p = 1;
  for (int i = 1; i < s.size(); i++) {
    if (i < p && len[2 * a - i] < p - i)
      len[i] = len[2 * a - i];
    else {
      int l = p - i;
      while (i + l < s.size() && s[i + l] == s[i - l]) l++;
      len[i] = l;
      a = i;
      p = i + l;
    }
  }
}
int nt[N];
void getnext(const string &s) {
  int i = 0, j = -1;
  nt[i] = j;
  while (s[i]) {
    if (j == -1 || s[i] == s[j]) {
      i++;
      j++;
      nt[i] = j;
    } else {
      j = nt[j];
    }
  }
}
void search(const string &s, const string &t) {
  int i = 0;
  int j = 0;
  while (s[i]) {
    if (j == -1 || s[i] == t[j]) {
      i++;
      j++;
      if (!t[j]) {
        del[i - (t.size() + 1) / 2] = 1;
        j = nt[j];
      }
    } else {
      j = nt[j];
    }
  }
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> ss;
  n = ss.size();
  bool ok = false;
  if (n / 2 <= 1) {
    cout << "Impossible" << '\n';
    return 0;
  }
  for (int i = 1; i < n / 2; i++) {
    if (ss[i] != ss[i - 1]) {
      ok = true;
    }
  }
  if (!ok) {
    cout << "Impossible" << '\n';
    return 0;
  }
  t.push_back('#');
  for (int i = 0; ss[i]; i++) {
    t.push_back(ss[i]);
    t.push_back('#');
  }
  ss = ss + ss;
  mana();
  int ans = 2;
  getnext(t);
  search(s, t);
  for (int i = 1; i < s.size(); i++) {
    if (n % 2 == 0) {
      if (s[i] != '#') continue;
    } else {
      if (s[i] == '#') continue;
    }
    if (del[i]) continue;
    if (len[i] >= n + 1) {
      ans = 1;
      break;
    }
  }
  cout << ans << '\n';
}
