#include <string.h>
#include <algorithm>
#include <stdio.h>

using namespace std;

typedef long long ll;

const int MAXN = 4e5 + 5, BASE = 26;
const ll MOD = 1000000007LL;

char str[MAXN];
ll powers[MAXN];

int main(){
  powers[0] = 1;
  for(int i=1; i<MAXN-1; ++i) powers[i] = (powers[i - 1] * BASE) % MOD;
  while(scanf("%s", str) != EOF){
    int N = strlen(str);
    ll pre = 0, suf = 0;
    int i = 0, j = N - 1;
    while(i <= N - 1 && j >= 0){
      pre = (pre + (1LL * (str[i] - 'a' + 1) * powers[i]) % MOD) % MOD;
      suf = ((suf * BASE) % MOD + 1LL * (str[j] - 'a' + 1)) % MOD;
      if(pre == suf) printf("%d ", i + 1);
      i++, j--;
    }
    puts("");
  }
  return 0;
}