Problem: Given a non-negative decimal integer $x$, convert it to binary representation $b$ of 32 bits. Then, print the result of the following operations to $b$ respecitvely.

* Inversion: change the state of each bit to the opposite state
* Logical left shift: shift left by 1
* Logical right shift: shift right by 1

Constraints

* $0 \leq x \leq 2^{32} - 1$

Input

The input is given in the following format.


$x$


Output

Print the given bits, results of inversion, left shift and right shift in a line respectively.

Examples

Input

8


Output

00000000000000000000000000001000
11111111111111111111111111110111
00000000000000000000000000010000
00000000000000000000000000000100


Input

13


Output

00000000000000000000000000001101
11111111111111111111111111110010
00000000000000000000000000011010
00000000000000000000000000000110

Solution (in CPP):

Solution:
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

string ten_to_two(lint N) {
	//10進数から2進数
	string ans;
	while (1) {
		ans.push_back(char('0' + N % 2));
		N /= 2;
		if (N == 0) {
			break;
		}
	}
	while (1) {
		if (ans.size() == 32) {
			break;
		}
		ans.push_back('0');
	}
	reverse(ans);
	return ans;
}

int main() {
	lint X;
	cin >> X;
	string S = ten_to_two(X);
	cout << S << endl;
	rep(i, S.size()) {
		if (S[i] == '0') {
			cout << '1';
		}
		else if (S[i] == '1'){
			cout << '0';
		}
	}
	cout << endl;
	for (int i = 1; i < S.size(); i++) {
		cout << S[i];
	}
	cout << '0' << endl;
	cout << '0';
	for (int i = 0; i < S.size() - 1; i++) {
		cout << S[i];
	}
	cout << endl;
}