for i in range(int(input())): a=int(input()) if (a%10==0) and (a%8==0): print(ikisugi) elif (a%10==0): print(sugi) else: print(a//3)