t=input()
k=[]
while t:
    t=t-1
    num=input()    
    if num>0 and num<4:
    	k.append(str(1))    	
    elif num%3==0:
    	k.append(str(num/3))
    else:
    	k.append(str(num))
#print k
print '\n'.join(k)