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

int main(){
	int n;
	scanf("%d", &n);
	bitset<32> bit(n);
	cout << bit << '\n';
	cout << bit.flip() << '\n';
	bit.flip();
	cout << (bit << 1) << '\n';
	cout << (bit >> 1) << '\n';
}

