#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 100010, M = N * 2;
int n, m;
int h[N], e[M], ne[M], idx;
bool st[N];
// 树、图的存储(邻接表)
void add(int a, int b) {
e[idx] = b, ne[idx] = h[a], h[a] = idx ++;
}
// 树、图的深度优先搜索
void dfs(int u) {
st[u] = true; // 标记一下,已经被搜过了
for (int i = h[u]; i != -1; i = ne[i]) {
int j = e[i];
if(!st[j]) dfs(j);
}
}
// 主函数初始化....
int main() {
memset(h, -1, sizeof h);
dfs(1);
return 0;
}