#include #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair pll; bool chkmax(int &x,int y){return xy?x=y,true:false;} ll readint(){ ll x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } ll n; int main(){ int T=readint(); while(T--){ n=readint(); if(n%6==1) cout<<1+n/6*4<