'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
test_cases = input()
for i in xrange(test_cases):
    ip = input()
    if ip<=3 and ip>0:
        print 1
    elif ip == 0:
    	print 0
    elif ip%3==0:
        print ip/3
    else:
        print ip