#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
void swaps(char *x, char *y) {
  char temp;
  temp = *x;
  *x = *y;
  *y = temp;
}
void swapi(int a, int b) {
  int temp;
  temp = a;
  a = b;
  b = temp;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == 1 || b == 1) return 1;
  if (a == b) return a;
  if (a > b)
    return gcd(b, a % b);
  else
    return gcd(a, b % a);
}
unsigned long long mult1(long long a, long long b) {
  long long res = 0;
  a %= 1000000007;
  while (b) {
    if (b & 1) {
      res = (res + a) % 1000000007;
    }
    a = (2 * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
const int base = 27;
int val[300007], HashValR[300007], HashVal[300007];
string str;
void preprocess() {}
long long hashValR(long long l, long long r) {
  if (l > r) {
    return 0;
  }
  return ((HashValR[r] - HashValR[l - 1]) % 1000000007 + 1000000007) %
         1000000007 * val[str.size() - r] % 1000000007;
}
long long hashVal(long long l, long long r) {
  if (l > r) {
    return 0;
  }
  return ((HashVal[r] - HashVal[l - 1]) % 1000000007 + 1000000007) %
         1000000007 * val[str.size() - r] % 1000000007;
}
void refresh() {}
void compute() {
  cin >> str;
  bool flag = false;
  long long size = str.size();
  long long ans = 2;
  val[0] = 1;
  for (long long i = (1); i <= (str.size()); i++) {
    val[i] = val[i - 1] * base % 1000000007;
  }
  HashVal[0] = 0;
  for (long long i = (1); i <= (str.size()); i++) {
    HashVal[i] =
        (HashVal[i - 1] + (str[i - 1] - 'a' + 1) * val[i]) % 1000000007;
  }
  reverse(str.begin(), str.end());
  HashValR[0] = 0;
  for (long long i = (1); i <= (str.size()); i++) {
    HashValR[i] =
        (HashValR[i - 1] + (str[i - 1] - 'a' + 1) * val[i]) % 1000000007;
  }
  for (long long i = 1; i < size / 2; i++) {
    if (str[i - 1] != str[i]) {
      flag = true;
    }
  }
  if (!flag) {
    cout << "Impossible" << endl;
    exit(0);
    ;
  }
  for (long long i = 1; i < size; i++) {
    string str1 = str.substr(i, size - i) + str.substr(0, i);
    string s2 = str1;
    reverse(str1.begin(), str1.end());
    if (s2 != str && s2 == str1) {
      ans = 1;
    }
  }
  if (ans == 1) {
    cout << "1" << endl;
  } else {
    cout << "2" << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  preprocess();
  int t = 1;
  while (t--) {
    compute();
  }
}
