Harryxun/stf_run huggingface dataset:
from collections import deque

n, m = list(map(int, input().split()))
AB = [[int(x) for x in input().split()] for _ in range(m)]

# representation matrix
repn = [[] for j in range(n)]
for a, b in AB:
    a -= 1
    b -= 1
    repn[a].append(b)
    repn[b].append(a)


# Minimum Spanning Tree
tree = [[] for i in range(n)]
visited = [True] + [False] * (n - 1)
q = deque([0]) # (vertex, depth)

while q:
    u = q.popleft()
    for v in repn[u]:
        if visited[v]:
            continue
        visited[v] = True
        tree[u].append(v)
        tree[v].append(u)
        q.append(v)


# define directions of the edges other than that of MST
degree = [0] * n
ans = []

for a, b in AB:
    a -= 1
    b -= 1
    if b in tree[a]:
        continue
    ans.append([a, b])
    degree[a] += 1


# defining orientations
def dfs(u = 0, parent = None):
    for v in tree[u]:
        if v == parent:
            continue
        dfs(v, u)
        if degree[v] % 2 == 0:
            ans.append([u, v])
            degree[u] += 1
        else:
            ans.append([v, u])
            degree[v] += 1

dfs()


# output answer
if degree[0] % 2 == 1:
    print(-1)
else:
    for pair in ans:
        c, d = pair
        c += 1
        d += 1
        print(' '.join(map(str, [c, d])))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
from collections import deque

n, m = map(int, input().split())

if m % 2 == 1:
    print(-1)
    exit()



AB = [[int(x) for x in input().split()] for _ in range(m)]

# representation matrix
repn = [[] for j in range(n + 1)]
for a, b in AB:
    repn[a].append(b)
    repn[b].append(a)


# Minimum Spanning Tree
tree = [set() for i in range(n + 1)]
visited = [False] * (n + 1)
visited[1] = True
q = deque([1])

while q:
    u = q.popleft()
    for v in repn[u]:
        if visited[v]:
            continue
        visited[v] = True
        tree[u].add(v)
        tree[v].add(u)
        q.append(v)


# define directions of the edges other than that of MST
degree = [0] * (n + 1)
ans = []

for a, b in AB:
    if b in tree[a]:
        continue
    ans.append('{} {}'.format(a, b))
    degree[a] += 1


# defining orientations
def dfs(u = 1, parent = None):
    for v in tree[u]:
        if v == parent:
            continue
        dfs(v, u)
        if degree[v] % 2 == 0:
            ans.append('{} {}'.format(u, v))
            degree[u] += 1
        else:
            ans.append('{} {}'.format(v, u))
            degree[v] += 1

dfs()

print('\n'.join(ans))
tate =int(raw_input())
yoko=int(raw_input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
    rep1,rep2=raw_input().split();
    rep1=int(rep1)-1
    rep2=int(rep2)-1
    arr[rep1],arr[rep2] = arr[rep2],arr[rep1]

for k in range(tate):
    print(arr[k])


### FIXED CODE ###

tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
    rep1,rep2=input().split(",")
    rep1=int(rep1)-1
    rep2=int(rep2)-1
    arr[rep1],arr[rep2] = arr[rep2],arr[rep1]

for k in range(tate):
    print(arr[k])
s = input()
print("yes" if len(s) = len(set(s))) else "not")

### FIXED CODE ###

import collections
s = input()
alph = "abcdefghijklmnopqrstuvwxyz"
col = dict(collections.Counter(s))

flag = True
for i in range(26):
    if col.get(alph[i], 0) > 1:
        print("no")
        flag = False
        break
if flag:
    print("yes")
s, t = input().split()
print("{}{}".format(t, s)

### FIXED CODE ###

s, t = input().split()
print("{}{}".format(t, s))
a, b = list(map(int, input().split()))

if a<=9 and b<=9:
  print(a*b)
  else:
    print(-1)
    

### FIXED CODE ###

a,b=map(int, input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)
a,b,c = input().split())
if b = '+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

### FIXED CODE ###

a,b,c = input().split()
if str(b) == '+':
  print(int(a)+int(c))
else:
  print(int(a)-int(c))
a = input()
count0 = 0
count1 = 0
a = int(a)
while(a > 0):
    if(a%2 ==0):
        count0 = count0 + 1
        a = a/10
    else:
        count1 = count1 + 1
        a = (a-1)/10

print(min(count0,count1)*2)


### FIXED CODE ###

a = input()
count0 = 0
count1 = 0
b = len(a)
for i in range(b):
    if(a[i] == "0") :
        count0 = count0 + 1
    else:
        count1 = count1 + 1

print(min(count0,count1)*2)
n,m = map(int, input().split())
xl = list(map(int, input().split())) 
yl = list(map(int, input().split())) 

xsum = sum(xl)
ysum = sum(yl)
for i in range(n):
    xi += xsum - xl[i]*(n-i)
    xsum -= xl[i] 
    
for j in range(m):
    yi += ysum - yl[j]*(m-j)
    ysum -= yl[j]

print(xi*yi)

### FIXED CODE ###

n,m = map(int, input().split())
xl = list(map(int, input().split())) 
yl = list(map(int, input().split())) 

xl = list(map(lambda x: x-xl[0],xl))
yl = list(map(lambda x: x-yl[0],yl))

xi=0
yi=0
mod = 10**9+7
xsum = sum(xl)
ysum = sum(yl)
for i in range(n):
    xi += (xsum - xl[i]*(n-i)) % mod
    xsum -= xl[i] 
    
for j in range(m):
    yi += (ysum - yl[j]*(m-j)) % mod
    ysum -= yl[j]

print(xi*yi % mod)
a, b, c = map(int, input().split())

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")
a, b = map(int, input().split())
print((a + b)//2)


### FIXED CODE ###

a, b = map(int, input().split())
print((a + b)//2)
#!/usr/bin/env python

def input():
    return sys.stdin.readline()[:-1]

def main():
    n, a, b = map(int, input().split())
    print(n // (a+b) * a + min(n % (a+b), a))

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python

def main():
    n, a, b = map(int, input().split())
    print(n // (a+b) * a + min(n % (a+b), a))

if __name__ == '__main__':
    main()
n = ii()

print(int(((n+1)*n)/2-n))

### FIXED CODE ###

n = int(input())
m = int(((n-1)*n)//2)
print(m)
K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
result = 'NG'
for i in range (A, B + 1):
    if i % K == 0:
        result = 'OK'
print(result)
n = int(input())
x=list(map(int, input().split()))

ma = max(x)
mi = min(x)
z = 0
a = []
for i in range(mi,ma):
    for j in range(n):
        y = (x[j] - (mi+i))**2
        z += y
    a.append(z)
    z = 0

print(min(a))

### FIXED CODE ###

n = int(input())
x=list(map(int, input().split()))

mn=10**7
for i in range(1,101):
    hp=0
    for k in range(n):
        hp+=(x[k]-i)**2
    if hp<mn:
        mn=hp

print(mn)
r = int(input())
if r < 1200:
  print(ABC)
if 1200 <= r < 2800:
  print(ARC)
else:
  print(AGC)

### FIXED CODE ###

r = int(input())
if r < 1200:
  print('ABC')
elif 1200 <= r < 2800:
  print('ARC')
else:
  print('AGC')
import itertools
import bisect
x = int(input())
acc = list(itertools.accumulate(list(range(1, x+1))))
index = bisect.bisect_left(acc, x)
#print(acc)
if acc[index] == x:
    print(index+1)
else:
    print(index+1)

### FIXED CODE ###

x = int(input())
total = 0
for i in range(1,x+1):
    total += i
    if total >= x:
        print(i)
        exit()
n,k = map(int,input().split())
a = list(map(int,input().split()))
mod = 10**9+7
a.sort()
mi = []
pl = []
zero = 0
for i in a:
    if i < 0:
        mi.append(i)
    elif i == 0:
        zero += 1
    else:
        pl.append(i)

if n-zero < k:
    print(0)
    exit()
if mi == []:
    ans = 1
    count = 0
    while count < k:
        ans *= a[-1-count]
        ans %= mod
        count += 1
    print(ans)
    
    exit()
if pl == []:
    if k%2:
        if zero:
            print(0)
        else:
            ans = 1
            count = 0
            while count < k:
                ans *= a[-1-count]
                ans %= mod
                count += 1
            print(ans)
            
    else:
        ans = 1
        count = 0
        while count < k:
            ans *= a[count]
            ans %= mod
            count += 1
        print(ans)
        
    exit()

ans = 0
ip = 0
im = 0
if k%2:
    count = pl[-1]
    k -= 1
    ip += 1
else:
    count = 1
while k > 0:
    check1 = True
    check2 = True
    if ip+2 <= len(pl):
        x = pl[-1-ip]*pl[-2-ip]
        
    else:
        x = 1
        check1 = False
    if im+2 <= len(pl):
        y = mi[im]*mi[im+1]
    else:
        y = 1
        check2 = False
    if x >= y:
        if check1:
            ip += 2
        count = (x*count)%mod
    else:
        if check2:
            im += 2
        count = (y*count)%mod
    if check1 == False and check2 == False:
        break
    k -= 2
if k:
    print(0)
else:
    print(count%mod)

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
mod = 10**9+7
a.sort()
mi = []
pl = []
if n == k:
    ans = 1
    for i in a:
        ans *= i
        ans %= mod
    print(ans)
    exit()
for i in a:
    if i < 0:
        mi.append(i)
    else:
        pl.append(i)
if pl == []:
    ans = 1
    count = 0
    if k%2:
        while count < k:
            ans *= a[-1-count]
            ans %= mod
            count += 1
    else:
        while count < k:
            ans *= a[count]
            ans %= mod
            count += 1
    print(ans)    
    exit()
pl = sorted(pl,reverse=True)
ip = 0
im = 0
if k%2:
    count = pl[0]
    k -= 1
    ip += 1
else:
    count = 1
while k > 0:
    check1 = True
    check2 = True
    if ip+2 <= len(pl):
        x = pl[ip]*pl[ip+1]    
    else:
        x = 1
        check1 = False
    if im+2 <= len(mi):
        y = mi[im]*mi[im+1]
    else:
        y = 1
        check2 = False
    if x > y or (check1 and not check2):
        ip += 2
        count = (x*count)%mod
    else:
        if check2:
            im += 2
            count = (y*count)%mod
    if check1 == False and check2 == False:
        break
    k -= 2

print(count%mod)
a = int(input()) // 値の数
b = list(map(int, input().split()))
min = 100000
for i in range(a):
  try = 0
  while(b[i]%2 != 0):
    b[i] = b[i] / 2
    try += 1
  if try < min:
    min = try
print(min)

### FIXED CODE ###

a = int(input())
b = list(map(int, input().split()))
count = 0
while(1):
  flag = 0
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      flag = 1
  if (flag == 1) :
    break
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)
, D = list(map(int,input().split()))
X = []
for i in range(N):
    X.append(list(map(int,input().split())))
#print(X)
count = 0
for i in range(0,N,1):
    for j in range(i+1,N,1):
        wa = 0
        for k in range(D):
            wa += (X[i][k] - X[j][k])**2
        if wa**0.5 == int(wa**0.5):
            count += 1
print(count)

### FIXED CODE ###

N, D = list(map(int,input().split()))
X = []
for i in range(N):
    X.append(list(map(int,input().split())))
#print(X)
count = 0
for i in range(0,N,1):
    for j in range(i+1,N,1):
        wa = 0
        for k in range(D):
            wa += (X[i][k] - X[j][k])**2
        if wa**0.5 == int(wa**0.5):
            count += 1
print(count)
n = int(input())
dic = {}
for _ in range(n):
  tmp = int(input())
  if tmp in dic and dic[tmp] == 1:
    dic[tmp] == 0
  else:
    dic[tmp] = 1
print(sum([*dic.values()]))

### FIXED CODE ###

n = int(input())
dic = {}
for _ in range(n):
  tmp = int(input())
  if tmp in dic and dic[tmp] == 1:
    dic[tmp] = 0
  else:
    dic[tmp] = 1
print(sum(dic.values()))
a,b,k=map(int,innput().split())
if a>=k:
  print(a-k,b)
else:
  print(0,b-(k-a))


### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a+b>=k:
  print(0,b-(k-a))
else:
  print(0,0)
A, B, C = map(int, input().split())
print(max(C - (A - B)), 0)

### FIXED CODE ###

A, B, C = map(int, input().split())
print(max(C - (A - B), 0))
import sys
mod = 10 ** 9 + 7

n,m = map(int,input().split())
if n in [0,1]:
    print(1)
    sys.exit()
    
if not m == 0:
    lis = [int(input()) for x in range(m)]
else:
    lis = []
val1 = 1
if 1 in lis:
    val2 = 0
else:
    val2 = 1

if lis[0] == 1:
    flg = lis[1]
    nex = 1
else:
    flg = lis[0]
    nex = 0
#print(lis)
for x in range(2,n):
    if x == flg: #x in lis
        #print(flg)
        nex += 1
        try: flg = lis[nex]
        except:flg = 0
        now = 0
    else:
        now = (val1 + val2) % mod
    val1,val2 = val2,now
    
print((val1 + val2) % mod)

### FIXED CODE ###

import sys
mod = 10 ** 9 + 7

n,m = map(int,input().split())
if n in [0,1]:
    print(1)
    sys.exit()
    
if not m == 0: lis = [int(input()) for x in range(m)]
else: lis = [-1]
val1 = 1
if 1 in lis: val2 = 0
else: val2 = 1

if lis[0] == 1 and len(lis) >= 2:
    flg = lis[1]
    nex = 1
else:
    flg = lis[0]
    nex = 0
#print(lis)
for x in range(2,n):
    if x == flg: #x in lis
        #print(flg)
        nex += 1
        try: flg = lis[nex]
        except:flg = 0
        now = 0
    else:
        now = (val1 + val2) % mod
    val1,val2 = val2,now
    
print((val1 + val2) % mod)
N, M = map(int, input().split())

A = []
for i in range(M):
  A.append(int(input()))

A.sort()
ida = 0
a = A[ida]
mod = 10**9 + 7

x = [1] + [0]*N
if a == 1:
  ida += 1
  if M >= 2:
    a = A[ida]
  else:
    x[1] = 1

for i in range(2, N+1):
  if i == a:
    ida += 1
    if ida >= M:
      a = N+1
    else:
      a = A[ida]
  
    x[i] = 0
  else:
    x[i] = (x[i-1] + x[i-2]) % mod

print(x[N])

### FIXED CODE ###

N, M = map(int, input().split())
x = [1] + [0] * N
broken = [False] * (N+1)
mod = 10**9 + 7

for i in range(M):
  a = int(input())
  broken[a] = True

if not broken[1]:
  x[1] = 1

for i in range(2, N+1):
  if broken[i]:
    continue
  
  x[i] = (x[i-1] + x[i-2]) % mod

print(x[N])
import math

def lcm(x, y):
    return x // math.gcd(x, y) * y
n = int(input())
a = list(map(int, input().split(' ')))
l = 1
for ai in a:
    l = lcm(l, ai)
mod = 1000000007
ans = 0
for ai in a:
    ans += l // ai
ans %= mod
print(ans)


### FIXED CODE ###

def gcd(x, y):
    x = x % y
    if x == 0:
        return y
    return gcd(y, x)

def lcm(x, y):
    return x // gcd(x, y) * y
n = int(input())
a = list(map(int, input().split(' ')))
l = 1
for ai in a:
    l = lcm(l, ai)
mod = 1000000007
ans = 0
for ai in a:
    ans += l // ai
ans %= mod
print(ans)
s = input()

if 'N' in s:
    if 'S' in s:
        ans = 'Yes'
    else:
        ans = 'No'
        print(ans)
        exit()
if 'W' in s:
    if 'E' in s:
        ans = 'Yes'
    else:
        ans = 'No'
        print(ans)
        exit()

print(ans)


### FIXED CODE ###

s = input()

if ('N' in s and 'S' in s) or ('N' not in s and 'S' not in s):
    if ('W' in s and 'E' in s) or ('W' not in s and 'E' not in s):
        print('Yes')
        exit()

print('No')
n, k = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

index = 0
keiro = []
s_keiro = set()

for i in range(k):
  index = al[index] - 1
  if index in s_keiro:
    start = keiro.index(index)
    mod = i - start
    break
  s_keiro.add(index)
  keiro.append(index)

pos = (k-start) % mod
print(keiro[start + pos - 1]+1)

### FIXED CODE ###

n, k = [int(i) for i in input().split()]
al = [int(i) for i in input().split()]

index = 0
keiro = []
s_keiro = set()
loop_f = False

for i in range(k):
  index = al[index] - 1
  if index in s_keiro:
    start = keiro.index(index)
    mod = i - start
    loop_f = True
    break
  s_keiro.add(index)
  keiro.append(index)

if loop_f:
  pos = (k-start-1) % mod
  if mod == 1:
    print(keiro[start]+1)
  else:
    print(keiro[start + pos]+1)
else:
  print(keiro[-1] + 1)
from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    
    i+=1

print(sum(A))

### FIXED CODE ###

from operator import itemgetter
              

N, M = map(int, input().split())
A = input().split()
A = list(map(int, A))
A.sort()


cng = []
for i in range(M):
    B, C = map(int, input().split())
    cng.append((B,C))
    
cng = sorted(cng, key=itemgetter(1),reverse=True)

f=1
i=0
crd_cnt=0
crd_idx=0
while(f==1):
    if(A[i]<=cng[crd_idx][1]):
        A[i] = cng[crd_idx][1]
        crd_cnt += 1
    else:
        f=0

    if(N==crd_cnt):
        f=0

    if(crd_cnt==cng[crd_idx][0]):
        crd_idx += 1
        crd_cnt = 0
    
    if(M==crd_idx):
        f=0
    elif(i+1==N):
        f=0
    
    i+=1

print(sum(A))
N, M = map(int, input().split())

import numpy as np

A = np.asarray(range(N))
B = np.asarray(range(M))
A = A.cumsum()
B = B.cumsum()

print(A[-1] + B[-1])


### FIXED CODE ###

N, M = map(int, input().split())

import numpy as np

A = np.asarray(range(max(1, N)))
B = np.asarray(range(max(1, M)))
A = A.cumsum()
B = B.cumsum()

print(A[-1] + B[-1])
#97a
n = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
print(array[-1])

### FIXED CODE ###

#97a
a,b,c,d=map(int,input().split())

if a<=b<=c or c<=b<=a:
    if abs(a-b)<=d and abs(c-b)<=d:
        print('Yes')

    else:
        print('No')
else:
    if abs(a-c)<=d:
        print('Yes')
    else:
        print('No')
X = int(input)

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

print(n)

### FIXED CODE ###

X = int(input())

if 100 <= X <= 111:
  n = 111
elif X <= 222:
  n = 222
elif X <= 333:
  n = 333
elif X <= 444:
  n = 444
elif X <= 555:
  n = 555
elif X <= 666:
  n = 666
elif X <= 777:
  n = 777
elif X <= 888:
  n = 888
elif X <= 999:
  n = 999
else:
  print("error")

print(n)
x, s = *open(0),
print(x)
print(s)
n, a, b = map(int, x.rstrip.split())

p = 0
wp = 0

for char in s:
    if char == 'c' or p >= a+b:
        print('No')
        continue
    if char == 'a':
        p += 1
        print('Yes')
        continue
    if wp < b:
        p += 1
        wp += 1
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

x = input()
s = input()

n, a, b = map(int, x.split())

p = 0
wp = 0

for char in s:
    if char == 'c' or p >= a+b:
        print('No')
        continue
    if char == 'a':
        p += 1
        print('Yes')
        continue
    if wp < b:
        p += 1
        wp += 1
        print('Yes')
    else:
        print('No')
#C
n, m = map(int, input().split())
k = [] * m
s = [] * m
p = [] * m
for i in range(m):
    ks = list(map(int, input().split()))
    k.append(ks[0])
    s.append(ks[1:])
p = list(map(int, input().split()))

print(k, s, p)
for i in range(2 ** n):
    on = Ture
    for j in range(m):
        light = 0
        for k in s[j]:
            tmp = i >> k & 2
            light = (light + tmp) % 2
        if light != p[j]:
            on = False
            break
    ans += int(on)
print(ans)

### FIXED CODE ###

# C
n, m = map(int, input().split())
k =[0]*m
s = [0]*m
for i in range(m):
    lst=input().split()
    k[i] = int(lst[0])
    s[i] = [int(x) - 1 for x in lst[1:]]
p = [int(x) for x in input().split()]
# print(s, p)
ans=0
for i in range(2 ** n):
    all_on = True
    for j in range(m):
        light = 0
        for k in s[j]:
            tmp = i >> k & 1
            #iをkだけ左にシフトし1とのANDをとる
            #>>iのk番目が1の時１を返す
            light = (light + tmp) % 2
            # print(tmp,light)
        if light != p[j]:
            all_on = False
            # print(light,p[j])
            break
    ans += int(all_on)
print(ans)
a = int (input())
if a>81:
  print("No")
else:
  c = 1
  for i in range(7):
    b = a/(9-i)
    
    if b.is_integer()==True and b<10:
      c = 0
    else:
      c = c*1
if c==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = int (input())  

if a>81:
  print("No")
else:
  c = 1
  for i in range(9):
    b = a/(9-i)
    
    if b.is_integer()==True and b<10:
      c = 0
    else:
      c = c*1
  if c==0:
    print("Yes")
  else:
    print("No")
import sys, os, re
from pprint import pprint
from math import sin, cos, sqrt, radians

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(n):
    x, y = list(map(int, sys.stdin.readline().strip().split()))
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

ans = {0: -1}

while len(ans) < n:
    flag = False
    for k, v in ans.items():
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break

print("Yes")
for i in range(1, n):
    print(ans[i]+1)

### FIXED CODE ###


import sys, os, re
from pprint import pprint
from math import sin, cos, sqrt, radians

n, m = list(map(int, sys.stdin.readline().strip().split()))
g = [[] for x in range(n)]

for i in range(m):
    x, y = map(int, sys.stdin.readline().strip().split())
    x -= 1
    y -= 1
    g[x].append(y)
    g[y].append(x)

if [] in g:
    print("No")
    exit(0)

ans = {0: -1}
tmp = [0]

while len(ans) < n:
    tmp_next = []
    for k in tmp:
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                tmp_next.append(node) 
                flag = True

        tmp = tmp_next
        if flag == False:
            break

    """
    flag = False    
    for k, v in list(ans.items()):
        for node in g[k]:
            if node not in ans:
                ans[node] = k
                flag = True
    if flag == False:
        break
    """

print("Yes")
for i in range(1, n):
    print(ans[i]+1)
a,b = map(int,input().split())

temp=["#" for _ in b+2]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + input() + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)

### FIXED CODE ###

a,b = map(int,input().split())

temp=["#" for _ in range(b+2)]
mass = []
mass.append(temp)
for _ in range(a):
  mass.append(["#"] + list(input()) + ["#"])
mass.append(temp)

for retsu in mass:
  retsu = "".join(retsu)
  print(retsu)
import math

MOD = 1000000007
N = int(input())
A = list(map(int,input().split()))
math.gcd(5,4)

### FIXED CODE ###

def lcm(X,Y):
    x=X
    y=Y
    if y>x:
        x,y=y,x
    while x%y!=0:
        x,y=y,x%y
    return X*Y//y

MOD = 1000000007
N = int(input())
A = list(map(int,input().split()))

LCM = A[0]
for i in range(0,N-1,1):
    LCM = lcm(LCM,A[i+1])
B = [0 for i in range(0,N,1)]
for i in range(0,N,1):
    B[i]= (LCM%MOD)*pow(A[i],MOD-2,MOD)%MOD

ans = 0
for i in range(0,N,1):
    ans = (B[i] + ans)%MOD

print(ans)
a = imput("please imput number 1st:")
b = imput("please imput number 2nd:")
c = a * b

if (1 <= a <= 100) and (1 <= b <= 100):
  print(c)
  else:
    print("check number again")
end

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
import math

n, d = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    for j in range(i+1, n):
        dis = 0
        for k in range(d):
            dis += (x[i][k]-x[j][k])**2
        if math.sqrt(dis) % 1 == 0:
            cnt += 1
print(cnt)

### FIXED CODE ###

a,b,c = map(int, input().split())
if a*b <= c:
    print(a*b)
else:
    print(c)
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
A = l()
L = []
L2 = [0]*(10**6)
for i in range(N):
    if i+A[i]+1 < 10**6:
        L.append(i+A[i]+1)
    if i-A[i]+1 >= 0 and i-A[i]+1 < 10**6:
        L2[i-A[i]+1] += 1
ans = 0
for l in L:
    ans += L2[l]
print(ans)

### FIXED CODE ###

S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')