import std.stdio, std.string, std.array, std.conv;

void main() {
    long n = readln.chomp.to!long;
    int[] a = new int[32];
    int[] b = new int[32];
    int[] c = new int[32];
    int[] d = new int[32];
    long m = n << 1;
    long l = n >> 1;
    foreach_reverse (i; 0 .. 32) {
        a[i] = n & 1;
        b[i] = !a[i];
        n /= 2;
        c[i] = m & 1;
        m /= 2;
        d[i] = l & 1;
        l /= 2;
    }
    a.to!(string[]).join.writeln;
    b.to!(string[]).join.writeln;
    c.to!(string[]).join.writeln;
    d.to!(string[]).join.writeln;
}
