#include <bits/stdc++.h>
using namespace std;
int reverse(int number) {
  int num = 0;
  for (int k = 0; k < 8; k++) {
    num = 2 * num;
    if ((number >> k) & 1) {
      num++;
    }
  }
  return num;
}
int main() {
  char c;
  int prev = 0;
  while (scanf("%c", &c) != EOF) {
    if (c == '\n') continue;
    for (int a = 0; a < 256; a++) {
      int res = reverse(prev);
      int b = (res - a + 256) % 256;
      b = reverse(b);
      if (b == c) {
        printf("%d\n", a);
        prev = c;
        break;
      }
    }
  }
  return 0;
}
