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