#include<bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define MAX 100005
#define INF 1001001001

int main(int, char**)
{
  ull x; cin >> x;
  bitset<32> b(x);
  cout << b << endl;
  cout << ~b << endl;
  cout << (b << 1) << endl;
  cout << (b >> 1) << endl;

  return 0;
}

