#include <bits/stdc++.h>
using namespace std;
long long mn, mx;
int T, K, N, c1, c2;
vector<pair<int, int> > g[200201];
int sub[200201];
int DFS(int n, int prev) {
  vector<int> sub;
  int odd = 0;
  for (int i = 0; i < g[n].size(); i++) {
    int next = g[n][i].first, cost = g[n][i].second;
    if (next == prev) continue;
    if (DFS(next, n) == 1) mn += cost, odd ^= 1;
  }
  if (odd) return 0;
  return 1;
}
int DFS2(int n, int prev) {
  sub[n] = 1;
  for (int i = 0; i < g[n].size(); i++) {
    int next = g[n][i].first, cost = g[n][i].second;
    if (next == prev) continue;
    sub[n] += DFS2(next, n);
  }
  return sub[n];
}
void DFS3(int n, int prev, int re) {
  int m = 0;
  for (int i = 0; i < g[n].size(); i++) {
    int next = g[n][i].first, cost = g[n][i].second;
    if (next == prev) continue;
    DFS3(next, n, re + sub[n] - sub[next]);
    m = max(m, sub[next]);
  }
  if (m <= N / 2 && re <= N / 2) {
    if (c1 == -1)
      c1 = n;
    else if (c2 == -1)
      c2 = n;
  }
}
void DFS4(int n, int prev, long long h) {
  mx += h;
  for (int i = 0; i < g[n].size(); i++) {
    int next = g[n][i].first, cost = g[n][i].second;
    if (next == prev) continue;
    DFS4(next, n, h + cost);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> T;
  while (T--) {
    mn = 0;
    mx = 0;
    c1 = -1;
    c2 = -1;
    cin >> K;
    N = 2 * K;
    for (int i = 1; i <= N; i++) g[i].clear();
    for (int i = 0; i < N - 1; i++) {
      int a, b, c;
      cin >> a >> b >> c;
      g[a].push_back({b, c});
      g[b].push_back({a, c});
    }
    DFS(1, 0);
    DFS2(1, 0);
    DFS3(1, 0, 0);
    DFS4(c1, c2, 0);
    DFS4(c2, c1, 0);
    for (int i = 0; i < g[c1].size(); i++) {
      int next = g[c1][i].first, cost = g[c1][i].second;
      if (next == c2) {
        mx += (long long)cost * K;
        break;
      }
    }
    cout << mn << " " << mx << "\n";
  }
  return 0;
}
