#include <iostream>
#include <cstdio>
using namespace std;
int nxt[100], ver[100], head[100], dist[100];
//如果用next会名字空间冲突
int tot = 0;
void add(int x, int y, int z)
{
ver[++tot] = y;
nxt[tot] = head[x];
head[x] = tot;
dist[tot] = z;
}
void fun(int u)
{
for (int i = head[u]; i != 0; i = nxt[i])
{
cout << u << "->" << ver[i] << " "
<< "distance is:" << dist[i] << endl;
}
}
int main()
{
add(1, 2, 1);
add(1, 3, 2);
add(2, 3, 4);
add(3, 1, 5);
fun(1);
int m;
cin>>m;
return 0;
}