#include <bits/stdc++.h>
int diru[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dirv[] = {-1, 0, 1, -1, 1, -1, 0, 1};
using namespace std;
template <class T>
T sq(T n) {
  return n * n;
}
template <class T>
T gcd(T a, T b) {
  return (b != 0 ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(T a, T b) {
  return (a / gcd<T>(a, b) * b);
}
template <class T>
bool inside(T a, T b, T c) {
  return a <= b && b <= c;
}
template <class T>
void setmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void setmin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
char in[1000];
int tmp[1000];
int main() {
  int n, T, t = 1, m = 256, i, j, k;
  while (gets(in)) {
    int prev = 0;
    n = strlen(in);
    for (i = 0; i < n; i++) {
      int neww = 0, l = 0;
      for (j = 0; j < 8; j++) {
        if (prev & 1)
          tmp[l++] = 1;
        else
          tmp[l++] = 0;
        prev >>= 1;
      }
      int tw = 1;
      for (j = 7; j > -1; j--) {
        neww += tw * tmp[j];
        tw *= 2;
      }
      int cur = 500;
      k = in[i];
      l = prev = 0;
      for (j = 0; j < 8; j++) {
        if (k & 1)
          tmp[l++] = 1;
        else
          tmp[l++] = 0;
        k >>= 1;
      }
      tw = 1;
      for (j = 7; j > -1; j--) {
        prev += tw * tmp[j];
        tw *= 2;
      }
      while (1) {
        int x = neww - cur * m - (int)prev;
        if (x >= 0) {
          printf("%d\n", x);
          break;
        }
        cur--;
      }
      prev = (int)in[i];
    }
  }
  return 0;
}
