#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int ans1 = -1, ans2 = -1;
  int p = n / 3;
  if (p * 2 + p == n)
    cout << p << " " << p << '\n';
  else if (p * 2 + p < n) {
    int dis = n - (p * 2 + p);
    if (dis == 1)
      cout << p + 1 << " " << p << '\n';
    else if (dis == 2)
      cout << p << " " << p + 1 << '\n';
  } else if ((p + 1) * 2 + p + 1 > n) {
    int dis = ((p + 1) * 2 + p + 1) - n;
    if (dis == 1)
      cout << p << " " << p + 1 << '\n';
    else if (dis == 2)
      cout << p + 1 << " " << p << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
