#include <bits/stdc++.h>

using namespace std;

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

