#include<stdio.h>
#include<string.h>
#include<math.h>
#define N 110
using namespace std;
int head[N], cnt;
void Init()
{
memset(head, -1, sizeof(head));
cnt = 0;//表示边数
}
struct Edge
{
int u, v, flow, next;
}edge[N * N];
void Add(int u, int v, int flow)
{
edge[cnt].u = u;
edge[cnt].v = v;
edge[cnt].flow = flow;
edge[cnt].next = head[u];//edge[cnt].next表示第cnt条边中的u上一次出现的位置(即上一次出现在第几条边)
head[u] = cnt++;//head[u]表示u现在所在的位置(即u在第几条边)
}
int main()
{
int u, v, flow, m;
while(~scanf("%d", &m))
{
while(m--)
{
scanf("%d%d%%d", &u, &v, &flow);
Add(u, v, flow);
}
}
return 0;
}