#include <bits/stdc++.h>
using namespace std;
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
bool pal(string s) {
  for (int l = 0, r = s.size() - 1; l <= r; ++l, --r)
    if (s[l] != s[r]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    string a = s.substr(0, i + 1), b = s.substr(i + 1);
    if (pal(b + a) && (b + a) != s) {
      cout << 1 << endl;
      return 0;
    }
  }
  s = s + "#" + s;
  vector<int> z = z_function(s);
  int m = z.size();
  for (int i = m - 1; i > n + (n + 1) / 2; --i) {
    if (z[i] == 0) {
      cout << (n - 2 * (m - i) > 0 ? 2 : 1) << endl;
      return 0;
    }
  }
  cout << "Impossible" << endl;
  return 0;
}
