#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc, n, m1 = 0, m2 = 0, mod;
  scanf("%d", &tc);
  while (tc--) {
    scanf("%d", &n);
    m1 = m2 = n / 3;
    mod = n % 3;
    if (mod == 1) {
      m1++;
    } else if (mod == 2) {
      m2++;
    }
    printf("%d %d\n", m1, m2);
  }
  return 0;
}
