#include <bits/stdc++.h>
using namespace std;
string s;
int a[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
int rev(int);
int main() {
  getline(cin, s);
  for (int i = 0; i < s.length(); i++) {
    int x = 0;
    if (i > 0) x = rev(int(s[i - 1]));
    int y = rev(int(s[i]));
    if (x >= y)
      cout << x - y << endl;
    else
      cout << 256 - y + x << endl;
  }
  return 0;
}
int rev(int x) {
  string s = "";
  while (x > 0) {
    s = s + char(x % 2 + '0');
    x = x / 2;
  }
  while (s.length() < 8) s = s + '0';
  int xx = 0;
  for (int i = s.length() - 1; i >= 0; i--)
    if (s[i] == '1') xx += a[7 - i];
  return xx;
}
