#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = ll(1e9) + 7, inf = ll(1e18);
long long min(ll w, ll b) {
  if (w < b)
    return w;
  else
    return b;
}
void solve() {
  ll n;
  cin >> n;
  if (n % 3 == 0)
    cout << n / 3 << " " << n / 3 << "\n";
  else if (n % 3 == 1)
    cout << n / 3 + 1 << " " << n / 3 << "\n";
  else
    cout << n / 3 << " " << n / 3 + 1 << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
