#include <bits/stdc++.h>
using namespace std;
long long pow(long long a, int b) {
  long long result = a;
  for (int i = 0; i < b - 1; i++) result *= a;
  return result;
}
long long bin_to_dec(string str) {
  long long result = 0;
  int c = str.size();
  for (int i = 0; i < str.size(); i++) {
    c--;
    if (str[i] == '1') result += pow(2, c);
  }
  return result;
}
string dec_to_bin(long long k) {
  string result = "";
  while (k > 1) {
    int tmp = k % 2;
    switch (tmp) {
      case 0:
        result = '0' + result;
        break;
      case 1:
        result = '1' + result;
    }
    k = k / 2;
  }
  switch (k) {
    case 0:
      result = '0' + result;
      break;
    case 1:
      result = '1' + result;
  }
  while (result.size() < 8) result = '0' + result;
  return result;
}
int main(int argc, char *argv[]) {
  string str = "", tmp;
  cin >> tmp;
  str += tmp;
  while (cin >> tmp) str += " " + tmp;
  int p[105];
  p[0] = 0;
  for (int i = 1; i <= str.size(); i++) {
    string bin = dec_to_bin(str[i - 1]), bin2 = "";
    for (int j = bin.size() - 1; j >= 0; j--) bin2 += bin[j];
    p[i] = bin_to_dec(bin2);
    int k = p[i - 1] - p[i];
    if (k < 0) k = 256 + k;
    cout << k << endl;
  }
  return 0;
}
