#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename C>
ostream& operator<<(ostream& os, const vector<C>& v) {
  for (__typeof((v).begin()) __it = (v).begin(); __it != (v).end(); __it++)
    os << *(__it) << ' ';
  return os;
}
const int inf = 0x3f3f3f3f;
const double eps = 1e-5;
const int maxn = 100500;
tuple<int, int, int, int, int> es[maxn];
long long res[maxn];
struct dsu_t {
  int arr[maxn];
  long long cnt[maxn];
  inline int get(int v) { return arr[v] == v ? v : arr[v] = get(arr[v]); }
  inline void un(int a, int b) {
    int ap = get(a);
    int bp = get(b);
    if (rand() % 2) {
      arr[ap] = bp;
      cnt[bp] += cnt[ap];
    } else {
      arr[bp] = ap;
      cnt[ap] += cnt[bp];
    }
  }
  inline long long count(int v) { return cnt[get(v)]; }
  dsu_t() {
    for (int i = 0; i < maxn; i++) {
      arr[i] = i;
      cnt[i] = 1;
    }
  }
} dsu, dsu_later;
vector<int> g[maxn];
int num[maxn];
int last;
void dfs(int v, int p) {
  for (int i = 0; i < (int((g[v]).size())); i++)
    if (g[v][i] != p) {
      dfs(g[v][i], v);
    }
  num[v] = last++;
}
int main() {
  int n;
  cin >> n;
  n--;
  int mm = 0;
  for (int i = 0; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
    mm = max(mm, max(a, b));
    es[i] = make_tuple(c, 0, a, b, i);
  }
  dfs(0, -1);
  for (int i = 0; i < n; i++)
    get<1>(es[i]) = min(num[get<2>(es[i])], num[get<3>(es[i])]);
  sort(es, es + n);
  int start = 0;
  for (int i = 0; i < n; i++) {
    dsu.un(get<2>(es[i]), get<3>(es[i]));
    if (i < n - 1 && get<0>(es[i + 1]) == get<0>(es[i])) continue;
    for (int j = start; j <= i; j++) {
      int from = get<2>(es[j]);
      int to = get<3>(es[j]);
      if (num[to] < num[from]) swap(from, to);
      res[get<4>(es[j])] =
          (dsu.count(to) - dsu_later.count(from)) * dsu_later.count(from);
      dsu_later.un(to, from);
    }
    start = i + 1;
  }
  long long maxval = -1;
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (res[i] > maxval) {
      maxval = res[i];
      ans.clear();
      ans.push_back(i + 1);
    } else if (res[i] == maxval)
      ans.push_back(i + 1);
  }
  cout << maxval * 2 << ' ' << (int((ans).size())) << endl;
  cout << ans << endl;
  return 0;
}
