#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 2e5 + 5;
const int MAX = 2e6 + 5;
const int MOD = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(NULL));
  cout << fixed << setprecision(10);
  clock_t clk;
  clk = clock();
  ;
  int n;
  string s;
  cin >> s;
  n = s.length();
  vector<int> pos;
  for (int i = 0; i < n / 2; i++)
    if (s[0] != s[i]) pos.push_back(i);
  if (pos.size() == 0) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    string tmp = s.substr(i, n - i);
    tmp += s.substr(0, i);
    if (tmp != s) {
      int f = 1;
      for (int j = 0; j < n / 2; j++) {
        if (tmp[j] != tmp[n - j - 1]) {
          f = 0;
          break;
        }
      }
      if (f) {
        cout << "1";
        return 0;
      }
    }
  }
  cout << "2\n";
  clk = clock() - clk;
  cerr << fixed << setprecision(6) << "Time: " << ((double)clk) / CLOCKS_PER_SEC
       << "\n";
  return 0;
  ;
}
