n = eval(input("")) if n>15: for i in range(0,n+1): print("{:5b}".format(i)) else: for i in range(0,n+1): print("{:4b}".format(i)) ### indentation not visible in issue? ### though it passed all the test cases it could be improved