#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 * 1000 + 100;
int n, m;
long long ans[maxn];
pair<pair<long long, long long>, pair<long long, long long> > e[maxn];
long long par[maxn], sz[maxn];
vector<long long> ver;
vector<pair<long long, long long> > adj[maxn];
void dsu(int l, int r);
void merge(int u, int v);
int find_par(int v);
long long dfs(long long v, long long par, long long szt);
bool mark[maxn];
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v, w;
    cin >> u >> v >> w;
    u--, v--;
    e[i] = pair<pair<long long, long long>, pair<long long, long long> >(
        pair<long long, long long>(w, i), pair<long long, long long>(u, v));
  }
  m = n - 1;
  fill(par, par + n, -1);
  fill(sz, sz + n, 1);
  sort(e, e + m);
  for (int i = 0; i < m; i++) {
    int ind = i;
    while (ind < m && e[ind].first.first == e[i].first.first) ind++;
    dsu(i, ind);
    i = ind - 1;
  }
  long long mx = 0, op = 0;
  for (int i = 0; i < m; i++) mx = max(ans[i], mx);
  for (int i = 0; i < m; i++)
    if (ans[i] == mx) op++;
  cout << mx << " " << op << endl;
  for (int i = 0; i < m; i++)
    if (ans[i] == mx) cout << i + 1 << " ";
  cout << endl;
  return 0;
}
int find_par(int v) { return (par[v] == -1 ? v : (par[v] = find_par(par[v]))); }
void merge(int u, int v) {
  u = find_par(u);
  v = find_par(v);
  if (u == v) return;
  if (sz[u] > sz[v]) swap(u, v);
  par[u] = v;
  sz[v] += sz[u];
}
void dsu(int l, int r) {
  for (int i = l; i < r; i++) {
    int u = e[i].second.first, v = e[i].second.second;
    e[i].second.first = u = find_par(u), e[i].second.second = v = find_par(v);
    ver.push_back(u);
    ver.push_back(v);
  }
  sort(ver.begin(), ver.end());
  ver.resize(unique(ver.begin(), ver.end()) - ver.begin());
  for (int i = l; i < r; i++) {
    int u = e[i].second.first, v = e[i].second.second;
    u = lower_bound(ver.begin(), ver.end(), u) - ver.begin();
    v = lower_bound(ver.begin(), ver.end(), v) - ver.begin();
    adj[u].push_back(pair<long long, long long>(v, e[i].first.second));
    adj[v].push_back(pair<long long, long long>(u, e[i].first.second));
  }
  long long szt = 0;
  for (int i = 0; i < ver.size(); i++) {
    if (!mark[i]) {
      szt = 0;
      szt = dfs(i, -1, szt);
      dfs(i, -1, szt);
    }
  }
  for (int i = l; i < r; i++) merge(e[i].second.first, e[i].second.second);
  for (int i = 0; i < ver.size(); i++) adj[i].resize(0);
  fill(mark, mark + ver.size(), false);
  ver.resize(0);
}
long long dfs(long long v, long long par, long long szt) {
  mark[v] = true;
  long long res = sz[ver[v]];
  for (auto u2 : adj[v]) {
    int u = u2.first, ind = u2.second;
    if (u == par) continue;
    long long tmp = dfs(u, v, szt);
    res += tmp;
    ans[ind] = 2 * tmp * (szt - tmp);
  }
  return res;
}
