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

int main()
{
	long x;

	cin >> x;

	cout << std::bitset<32>(x) << endl;
	cout << std::bitset<32>(~x) << endl;
	cout << std::bitset<32>(x << 1) << endl;
	cout << std::bitset<32>(x >> 1) << endl;

	return 0;
}
