#include <bits/stdc++.h>
using namespace std;
double eps = 0.0000001;
double abss(double x) {
  if (x < 0)
    return -x;
  else
    return x;
}
int double_comparator(double a, double b) {
  if (abss(a - b) < eps)
    return 0;
  else if (a - b > 0)
    return 1;
  else
    return -1;
}
int twos[8] = {};
void build2step() {
  twos[0] = 1;
  for (int i = 1; i < 8; i++) twos[i] = twos[i - 1] * 2;
}
int invertbits(int num) {
  int i = 7;
  int two[8] = {};
  for (; i >= 0; i--) {
    if (num >= twos[i]) {
      two[7 - i] = 1;
      num -= twos[i];
    }
  }
  num = 0;
  for (i = 7; i >= 0; i--) {
    num *= 2;
    num += two[i];
  }
  return num;
}
int invertbits2(int num) {
  int i = 7;
  int two[8] = {};
  for (; i >= 0; i--) {
    if (num >= twos[i]) {
      two[i] = 0;
      num -= twos[i];
    } else
      two[i] = 1;
  }
  num = 0;
  for (i = 7; i >= 0; i--) {
    num *= 2;
    num += two[i];
  }
  return num;
}
int main() {
  char signs[110] = {};
  int i = 0;
  int prev = 0;
  signs[i] = getchar();
  for (i = 0; signs[i] != '\n'; i++) signs[i + 1] = getchar();
  signs[i] = '\0';
  build2step();
  i = 0;
  int num;
  while (signs[i] != '\0') {
    num = signs[i];
    num = invertbits(num);
    if (num > prev) {
      int backuprev = num;
      num = invertbits2(num);
      num += prev;
      prev = backuprev;
      printf("%d\n", num + 1);
    } else {
      prev -= num;
      printf("%d\n", prev);
      prev = num;
    }
    i++;
  }
  return 0;
}
