t=raw_input()
t=int(t)
ans=[]
for i in range(t):
        a=input()
        a=int(a)
        if a%3==0:
                ans.append(int(a/3))
        elif a<3:
        		ans.append(1)
        else:
                ans.append(a)
                
for i in ans:
        print i