#include <iostream>
using namespace std;

int main() {
    char c = 0;
    while (cin>>c) {
        int i = 7;
        char res[8] = {0};
        while(c){
            res[i--] = c%2;
            c>>=1;
        }
        bool odd = false;
        for(int x : res) if(x) odd = !odd;
        if(!odd) res[0]=1;
        for(int x : res) cout<<x;
        cout<<endl;
    }
}