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