#include <stdio.h>
int main()
{  
  unsigned short buffer;
  unsigned short prev;  
  unsigned short out;
  prev = 0;
  while (fread(&buffer, 2, 1, stdin) == 1) {
    out = buffer ^ prev;    
    prev = buffer;
    fwrite(&out, 2, 1, stdout);
  }
}
