#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int rec(int l, int r) {
  int len = r - l + 1;
  int d = len % 2;
  len /= 2;
  int res = -1;
  if (d) {
    bool a = true;
    bool b = true;
    for (int i = 0; i < len; i++) {
      if (s[i] != s[i + len + 1]) {
        a = false;
        break;
      }
    }
    for (int i = 0; i < len + 1; i++) {
      if (s[i] != s[i + len]) {
        b = false;
        break;
      }
    }
    if (a && b)
      return -1;
    else {
      if (r == (n - 1)) {
        bool check = true;
        for (int i = 1; i < len; i++) {
          if (s[i] != s[i - 1]) {
            check = false;
            break;
          }
        }
        if (check)
          return -1;
        else
          return 2;
      } else
        return 2;
    }
  }
  bool fl = true;
  for (int i = 0; i < len; i++) {
    if (s[i] != s[i + len]) {
      fl = false;
      break;
    }
  }
  if (fl)
    return rec(l, len - 1);
  else
    return 1 + d;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  n = s.length();
  int ans = rec(0, n - 1);
  if (ans == -1)
    cout << "Impossible" << endl;
  else
    cout << ans << endl;
  return 0;
}
