Mr. X is performing a trick with the cards.  He has N cards, lets name them 1.....N, on a round table.
So card 1 is in between 2nd card and Nth card.  Initially all cards are upside down. His trick involves making all cards face up.

His trick is whenever he taps on a card, it flips (if card was originally upside down, after flipping its faces up, and vice-versa), but he is no ordinary magician, he makes the two adjacent cards (if any) also to flip with the single tap. Formally, if he taps ith card, then i-1, i, i+1 cards are flipped. (Note that if he taps Nth card, then he flips (N-1)th, Nth and 1st card.)

Our magician needs a helper, to assist him in his magic tricks. He is looking for someone who can predict minimum number of taps needed to turn all the cards facing up.

Input : 
First line of input contains T, the number of test cases.
Then T lines follows, each line contains N, the number of cards for that particular case.

Output : 
Print the output for each case in a single line.

Constraints : 
1 ≤ T ≤ 10^5 
0 ≤ N ≤ 10^15

SAMPLE INPUT
2
2
3

SAMPLE OUTPUT
1
1

Difficulty: EASY

Solutions:
def card_list(test_case_count):
	number_of_card_list = []
	while test_case_count >= 1:
		no_of_cards = int(eval(input()))
		number_of_card_list.append(no_of_cards)
		test_case_count = test_case_count - 1
	return number_of_card_list



def minimal_attempts(total_card_list):
	toc=total_card_list
	for i in range(len(toc)):
		if toc[i] == 0:
			print((0))
		elif toc[i] < 3:
			print((1))
		elif toc[i] % 3 == 0:
			print((int(toc[i]/3)))
		else:
			print((toc[i]))


test_case_count = int(eval(input()))
total_card_list = card_list(test_case_count)
minimal_attempts(total_card_list)


T = int(input())
while T>0:
	T=T-1
	N= int(input())
	cnt=0
	q = N//3
	r = N%3
	if N==1 or N==2:
		print(1)
	elif r==0:
		print(q)
	else:
		print(N)