https://www.acmicpc.net/problem/24444from collections import dequeimport sysinput = sys.stdin.readlinesys.setrecursionlimit(10**7)n, m, r = map(int, input().split())graph = [[] for _ in range(n+1)]visited = [0] * (n+1)seq = 1que = deque()for _ in range(m): u, v = map(int, input().split()) graph[u].append(v) graph[v].append(u)def bfs(r): global seq visited[r] = seq seq += 1 q..