#include #include using namespace std; long long n; int main () { int t , i , j; scanf ( "%d" , &t ); while ( t-- ) { scanf ( "%I64d" , &n ); if ( n % 6 == 4 ) { printf ( "%I64d\n" , n - 1 ); } if ( n % 6 == 5 ) { printf ( "%I64d\n" , n / 6 ); } if ( n % 6 == 0 ) { printf ( "%I64d\n" , n / 2 ); } if ( n % 6 == 1 ) { printf ( "%I64d\n" , n * 2 / 3 + 1 ); } if ( n % 6 == 2 ) { printf ( "%I64d\n" , n / 2 ); } if ( n % 6 == 3 ) { printf ( "%I64d\n" , n / 6 ); } } return 0; }