r=range(105) for i in r:print sum(3**j*(i>>j&1)for j in r)