#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int c2 = (n + 1) / 3;
    long long int c1 = n - c2 * 2;
    cout << c1 << " " << c2 << endl;
  }
}
