#The solution in Python3 is as follows:
for _ in range(int(input())):
n = int(input())
print ((((n+1)*2)//3) % 1000000007)
#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!
If you want to hone your programming skills in python and improve your performance in competitive programming platforms, then this is the destination you are looking for. Happy Coding!!!