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

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
t = int(raw_input())
for t in xrange(t):
	n = int(raw_input())
	if n == 1 or n == 2 or n == 3:
		print 1
	elif n % 3 == 0:
		print n/3
	else:
		print n