#include <bits/stdc++.h>
using namespace std;
void solve() {
  int i = 0, j = 0, k = 0;
  int n;
  cin >> n;
  int num = n / 3;
  if (n % 3 == 2)
    cout << num << " " << num + 1 << "\n";
  else if (n % 3 == 1)
    cout << num + 1 << " " << num << "\n";
  else
    cout << num << " " << num << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t;
  cin >> t;
  while (t-- > 0) {
    solve();
  }
  return 0;
}
