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