#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long int x;
    cin >> x;
    bitset<32> b(x);

    cout << b << endl
         << ~b << endl
         << (b << 1) << endl
         << (b >> 1) << endl;
    return 0;
}
