#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int oneB = n / 3, twoB = oneB;
    int rem = n % 3;
    if (rem == 1)
      oneB++;
    else if (rem == 2)
      twoB++;
    cout << oneB << " " << twoB << endl;
  }
  return 0;
}
