#!/usr/bin/env python

# Prints a file in binary

from __future__ import print_function

import sys

if __name__ == '__main__':

	filename = sys.argv[1]

	with open(filename, 'rb') as f:
		byte = f.read(1)
		i = 1
		while byte:
			binstr = bin(ord(byte)).lstrip("0b")
			end = '\n' if i % 4 == 0 else ' '
			print((8-len(binstr)) * '0' + binstr, end=end)
			i += 1
			byte = f.read(1)
