for i 0->20: hash[1<<i]=i while n: cout<<hash[lowbit(n)] n-=lowbit(n)
or
for i 0->35: hash[(1ll<<i)%37]=i while n: cout<<hash[lowbit(n)%37] n-=lowbit(n)