#include <algorithm>
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;

int main() {
    unsigned x; cin >> x;
    bitset<32> b(x);
    cout << b << endl;
    cout << ~b << endl;
    cout << (b << 1) << endl;
    cout << (b >> 1) << endl;
    return 0;
}
