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