#include <bits/stdc++.h>
using namespace std;
int n, t, ans1, ans2;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    int x = n % 3;
    if (x == 0) {
      ans1 = n / 3;
      ans2 = ans1;
    } else {
      if (x == 1) {
        ans1 = (n - 1) / 3;
        ans2 = ans1;
        ans1++;
      } else {
        ans1 = (n - 2) / 3;
        ans2 = ans1;
        ans2++;
      }
    }
    cout << ans1 << " " << ans2 << endl;
  }
  return 0;
}
