#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
const long long INFLL = 2e18;
const int MAX = 1e5 + 20;
const long double pi = 3.14159265358979323846;
void usaco(string filename) {
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
void solve() {
  int n;
  cin >> n;
  int rem = n % 3;
  int one = (rem == 1), two = (rem == 2);
  cout << n / 3 + one << " " << n / 3 + two << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
