Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[i:i+2]:
            c += 1
    return c

table = [0]*len(S)

for i in range(len(S)):
    table[i] = count(S[i:])

for i in range(Q):
    print(table[L[i]-1] - table[R[i]-1])


### FIXED CODE ###

import sys

l = raw_input().split()
N = int(l[0])
Q = int(l[1])
l = raw_input().split()
S = l[0]

L = [0]*Q
R = [0]*Q

ac = 'AC'

for i in range(Q):
    l = raw_input().split()
    L[i] = int(l[0])
    R[i] = int(l[1])

#print(N,Q,S,L,R)

def count(S, table):
    length = len(S)
    c = 0
    for i in range(length - 1):
        # print(S[i:i+2])
        if ac == S[length - i - 2:length - i]:
            c += 1
        table[i+1] = c

length_S = len(S)
table = [0]*length_S

count(S, table)
# print(table)

for i in range(Q):
    print(table[length_S - L[i]] - table[length_S - R[i]])
### BUGGY CODE ###

a=int(input())
i=100
f=0
while i<a:
  if a>100000:
    a=a/100000
    i=i/100000
  i=int(i*1.01)
  f=f+1
print(f)


### FIXED CODE ###

a=int(input())
i=100
f=0
while i<a:
  i=i+i//100
  f=f+1
print(f)
### BUGGY CODE ###

import sys
import collections


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    d = collections.defaultdict(int)
    for i in range(n):
        d[a[i]] += 1
    t = 0
    for v in a:
        d[v] -= 1
        if d[v] == 0:
            d.pop(v)
        for k2, v2 in d.items():
            t += (v ^ k2) * v2
            t %= mod
    print(t)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    ls = [0] * 65
    for v in a:
        tt = bin(v)
        for i in range(len(tt)-2):
            ls[i] += int(tt[-i-1])
    t = 0
    for i in range(len(ls)):
        t += 2 ** i * (n - ls[i]) * ls[i]
        t %= mod
    print(t)


if __name__ == '__main__':
    solve()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

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

def soin(a):
    fa = []
    i = 2
    d = a
    last = 1
    while d>1:
        if d % i == 0:
            if last == i:
                fa[-1][1]=fa[-1][1]+1
            else:
                fa.append([i,1])
            d=d//i
            last = i
        else:
            i += 1
    return(fa)

#print(soin(n))
q = soin(m)
answer = 1

for i in q:
#    print(i,i[1])
    r = i[1]
    a = 1
    for j in range(n,n+r):
        a = a * j
    for j in range(r):
        a = a // (j+1)
    answer = answer * a % (10**9+7)

print(answer)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

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

def soin(a):
    fa = []
    i = 2
    d = a
    last = 1
    while d>1:
        if d % i == 0:
            if last == i:
                fa[-1][1]=fa[-1][1]+1
            else:
                fa.append([i,1])
            d=d//i
            last = i
        else:
            i += 1
        if i * i > a:
            fa.append([a,1])
            break

    return(fa)

#print(soin(n))
q = soin(m)
answer = 1

for i in q:
#    print(i,i[1])
    r = i[1]
    a = 1
    for j in range(n,n+r):
        a = a * j
    for j in range(r):
        a = a // (j+1)
    answer = answer * a % (10**9+7)

print(answer)
### BUGGY CODE ###

n= int(input())
l=[]
ll=[]
ans=[]
for i in range(n):
    if n%(i+1)==0:
        l.append(i+1)
        ll.append(int(n/(i+1)))
for i in range(len(l)):
    ans.append((l[i]-1)+(ll[i]-1))
print(min(ans))

### FIXED CODE ###

n=int(input())
ans=[]
for i in range(1,10**7):
    if i>=n:
        break
    elif n%i==0:
        ans.append(i+(n//i))
print(min(ans)-2)
### BUGGY CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = 0

for i in range(m):
  b, c = map(int, input().split())
  for j in range(b):
    a.append(c)

a.sort()
l = len(a)
for i in range(l-n, l):
  sum += a[i]

print(sum)



### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
s = []

for i in range(n):
  s.append((a[i], 1))

for _ in range(m):
  b, c = map(int, input().split())
  s.append((c, b))
#  for j in range(b):
#    a.append(c)

s.sort(reverse=True)
idx = 0
sum = 0
for i in range(n):
  if idx + s[i][1] > n:
    sum += s[i][0] * (n-idx)
    break

  sum += s[i][0] * s[i][1]
  idx += s[i][1]


# for i in range(l-n, l):
#  sum += a[i]

print(sum)
### BUGGY CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = float('inf')
max = 0
len_div = len(make_divisors(N))

if len_div % 2 == 0:
    for i in range(len_div // 2):
        A_len = len(str(make_divisors(N)[i]))
        B_len = len(str(make_divisors(N)[len_div - i - 1]))
        if A_len <= B_len:
            max = B_len
        else:
            max = A_len
        # print(A_len, B_len, max)
else:
    for i in range(len_div // 2 + 1):
        A_len = len(str(make_divisors(N)[i]))
        B_len = len(str(make_divisors(N)[len_div - i - 1]))
        # print(A_len, B_len)
        if A_len <= B_len:
            max = B_len
        else:
            max = A_len
        # print(A_len, B_len, max)

print(max)



### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = 0
len_div = len(make_divisors(N))
# print(make_divisors(N))
# print(make_divisors(N))
# print(make_divisors(N))
# print(len(make_divisors(N)))
# print(make_divisors(N)[len_div // 2])

if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    B_len = len(str(make_divisors(N)[len_div // 2]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
    # print(make_divisors(N)[len_div // 2])
print(answer)
### BUGGY CODE ###

import sys

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

cnt = 0
check = 1
ls = [i for i in range(1,N+1)]
c_ls = []
bool1 = False

for a in A:
  if a == check:
    c_ls.append(a)
    check += 1
  else:
    cnt += 1
  if c_ls == ls[:(N-cnt)] and c_ls != []:
    bool1 = True
    break

if bool1:
  print(cnt)
else:
  print(-1)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
cnt = 0
if 1 not in A:
  print(-1)
else:
  num = 1
  for i in range(N):
    if A[i] == num:
      num += 1
    else:
      cnt += 1
  print(cnt)
### BUGGY CODE ###

n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n + 1)

dp = [0] * (n + 1)
dp[0] = 1

for i in range(1, n + 1):
    if i not in s:
        dp[i] += dp[i - 1]
        if i > 1: dp[i] += dp[i - 2]
        dp[i] = dp[i] % (10 ** 9 + 7)

print(dp[n])


### FIXED CODE ###

n, m = map(int, input().split())
s = [int(input()) for _ in range(m)]
s.append(n+1)

dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1

for i in range(n - 1):
    dp[i + 2] = dp[i + 1] + dp[i]
mae = 0
ans = 1
for i in s:
    if i == mae:
        ans=0
    else:
        ans *= dp[i - 1 - mae]

    mae = i + 1
print(ans % (10 ** 9 + 7))
### BUGGY CODE ###

#!/usr/bin/env python3
from collections import deque

def main():
    H, W, K = map(int, input().split())
    x1, y1, x2, y2 = map(lambda x: int(x)-1, input().split())
    c = [input() for _ in range(H)]

    adj = [[] for _ in range(W*H)]
    dx = [1,-1,0,0]
    dy = [0,0,1,-1]
    
    for i in range(H):
        for j in range(W):
            if c[i][j] == '@': continue
            for k in range(4):
                y = i + dy[k]
                x = j + dx[k]
                if 0 <= y < H and 0 <= x < W and c[y][x] == '.':
                    adj[W*i+j].append(W*y+x)
    
    queue = deque([W*x1+y1])
    visit = [-1] * (W*H)
    visit[W*x1+y1] = 0
    
    while queue:
        now = queue.popleft()
        for u in adj[now]:
            # nowからuの方向に'.'が続くかぎり（最大K個）
            count = 0
            direct = u - now
            fromC = now
            toC = u
            while count < K and toC in adj[fromC]:
                count += 1
                if visit[toC] < 0:
                    queue.append(toC)
                    visit[toC] = visit[now] + 1
                fromC = toC
                toC += direct 

    print(visit[W*x2+y2])

if __name__ == "__main__":
    main()

### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque

def main():
    H, W, K = map(int, input().split())
    x1, y1, x2, y2 = map(lambda x: int(x)-1, input().split())
    c = [input() for _ in range(H)]

    adj = [[] for _ in range(W*H)]
    dx = [1,-1,0,0]
    dy = [0,0,1,-1]
    INF = 10**12
    
    for i in range(H):
        for j in range(W):
            if c[i][j] == '@': continue
            for k in range(4):
                y = i + dy[k]
                x = j + dx[k]
                if 0 <= y < H and 0 <= x < W and c[y][x] == '.':
                    adj[W*i+j].append(W*y+x)
    
    queue = deque([W*x1+y1])
    visit = [INF] * (W*H)
    visit[W*x1+y1] = 0
    
    while queue:
        now = queue.popleft()
        for u in adj[now]:
            # nowからuの方向に'.'が続くかぎり（最大K個）
            count = 0
            direct = u - now
            fromC = now
            toC = u
            while count < K and toC in adj[fromC] and visit[now] < visit[toC]:
                count += 1
                if visit[toC] == INF:
                    queue.append(toC)
                    visit[toC] = visit[now] + 1
                fromC = toC
                toC += direct 

    print(visit[W*x2+y2]) if visit[W*x2+y2] < INF else print(-1)
    # print(visit)

if __name__ == "__main__":
    main()
### BUGGY CODE ###

import numpy as np
N,M = (int(X) for X in input().split())
Price = np.zeros((N,2),dtype=int)
for T in range(0,N):
    Price[T,:] = (np.array([int(X) for X in input().split()]))
Price = Price[np.argsort(Price[:,0])]
Drink = np.concatenate([np.full(Y,X) for X,Y in Price])[0:M]
print(sum(Drink))

### FIXED CODE ###

import numpy as np
N,M = (int(X) for X in input().split())
Shop = np.zeros((N,2),dtype=int)
for T in range(0,N):
    Shop[T,:] = (np.array([int(X) for X in input().split()]))
Shop = Shop[np.argsort(Shop[:,0])]
Rest = M
Pric = 0
for T in range(0,N):
    Pric += Shop[T,0]*Shop[T,1]
    Rest -= Shop[T,1]
    if Rest<0:
        Pric += Rest*Shop[T,0]
        break
print(Pric)
### BUGGY CODE ###

N = int(input())

ans = 0
for i in range(1, N+1):
    if N//i == N%i:
        ans += i

print(ans)

### FIXED CODE ###

N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

divisors = make_divisors(N)

ans = 0
for divisor in divisors:
	if divisor != 1:
		shou = N // (divisor-1)
		amari = N % (divisor-1)
		if shou == amari and divisor-1 > amari:
				ans += divisor-1

print(ans)
### BUGGY CODE ###

import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
import numpy as np
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

n, k = MAP()
a = LIST()


end = [n]*n

for i in range(min(k, 42)):
    b = [0]*(n+1)
    for i in range(n):
        b[max(i-a[i], 0)] +=1
        if i+a[i] <n:
            b[i+a[i]+1] -=1
    for i in range(1,n):
        b[i] += b[i-1]
    a = b[:n]

for i in range(n):
    print(str(int(a[i]))+" ",end = "" )

### FIXED CODE ###

import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

n, k = MAP()
a = LIST()


end = [n]*n

for i in range(min(k, 41)):
    b = [0]*(n+1)
    for j in range(n):
        b[max(j-a[j], 0)] +=1
        if j+a[j] <n:
            b[j+a[j]+1] -=1
    for j in range(1,n):
        b[j] += b[j-1]
    a = b[:n]

for i in range(n):
    print(str(int(a[i]))+" ",end = "" )
### BUGGY CODE ###

from collections import defaultdict

N,K=map(int,input().split())
A=list(map(int,input().split()))
mod=10**9+7

NOW={0:1}#そこまでの飴の個数,場合の数

for i in range(N):
    NEXT=defaultdict(int)
    for now in NOW:
        for j in range(A[i]+1):
            if now+j<=K:
                NEXT[now+j]=(NEXT[now+j]+NOW[now])%mod

    NOW=NEXT
    #print(NOW)

print(NOW[K])

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
mod=10**9+7

NOW=[0]*(K+1)
NOW[0]=1#そこまでi個使ったときの場合の数


for i in range(N):
    NEXT=[0]*(K+1)
    NOWSUM=[0]
    for n in NOW:
        NOWSUM.append(NOWSUM[-1]+n)
        
    for j in range(K+1):
        NEXT[j]=(NEXT[j]+NOWSUM[j+1]-NOWSUM[max(0,j-A[i])])%mod

    NOW=NEXT
    #print(NOWSUM,NOW)

print(NOW[K])
### BUGGY CODE ###

def productall(a):
    N = len(a)
    if N == 0: return [1]
    A = [1] * N + a[:]
    mad = 3030
    pa1 = (1 << k * 4 + 16) - ((1 << k * 4 + 16) % P)
    pa2 = (1 << k * 2 + 24) - ((1 << k * 2 + 24) % P)
    pa3 = (1 << k + 28) - ((1 << k + 28) % P)
    m1 = int(("1" * (k * 4 - 16) + "0" * (k * 4 + 16)) * mad, 2)
    m2 = int(("1" * (k * 6 - 24) + "0" * (k * 2 + 24)) * mad, 2)
    m3 = int(("1" * (k * 7 - 28) + "0" * (k + 28)) * mad, 2)
    m = int("1" * (k * 8) * mad, 2)
    def modP(x):
        x &= m
        x -= ((x & m1) >> k * 4 + 16) * pa1
        x -= ((x & m2) >> k * 2 + 24) * pa2
        x -= ((x & m3) >> k + 28) * pa3
        return x
 
    for i in range(N)[::-1]:
        A[i] = modP(A[2*i] * A[2*i+1])
 
    t = "0" * K * S + bin(A[1])[2:] + "_"
    return [int(t[-(i+1) * K - 1:-i * K - 1], 2) % P for i in range((len(t)+K-2) // K)][S]

P = 998244353
k = 12
K = k * 8
N, S = map(int, input().split())
A = [(1 << K * int(a)) + 2 for a in input().split()]
print(productall(A) % P)

### FIXED CODE ###

K = 96
N, S = map(int, input().split())
A = [int(a) for a in input().split()]
P = 998244353
pa = (1 << 64) - ((1 << 64) % P)
m = int(("1" * 32 + "0" * 64) * 3030, 2)
modP = lambda x: x - ((x & m) >> 64) * pa
s = 1 << K * S
for a in A:
    s = 2 * s + (s >> K * a)
    s = modP(s)
print((s & ((1 << K) - 1)) % P)
### BUGGY CODE ###

import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===
def main():
    n, c, k = ns()
    t = [ni() for _ in range(n)]
    t.sort()

    ans = 0
    while True:
        flg = True
        for i, ti in enumerate(t):
            if ti - t[0] > k:
                t = t[i:]
                flg = False
                break
            elif i + 1 >= c:
                t = t[i + 1:]
                flg = False
                break

        ans += 1

        if flg or len(t) == 0:
            break

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import re
import math
import collections
import decimal
import bisect
import itertools
import fractions
import functools
import copy

# import heapq
# from collections import deque
# import decimal

sys.setrecursionlimit(10000001)
INF = sys.maxsize
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===
def main():
    n, c, k = ns()
    t = [ni() for _ in range(n)]
    t.sort()

    ans = 0
    idx = 0
    while True:
        ans += 1

        k_idx = bisect.bisect_right(t, t[idx] + k)
        c_idx = idx + c

        idx = min(k_idx, c_idx)
        if idx > n-1:
            break

    print(ans)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,k = list(map(int, input().split()))
a = list(map(int, input().split()))

init = [1]
len_loop = -1

while len(init) <= k:
    nxt = a[init[-1]-1]
    if nxt in init:
        idx_nxt = init.index(nxt)
        len_init = idx_nxt
        len_loop = len(init) - idx_nxt
        break
    else:
        init.append(nxt)

if len_loop == -1:
    print(init[k])
else:
    idx = (k-len_init)%len_loop
    print(init[len_init+idx])

### FIXED CODE ###

n, k = map(int, input().split())
a = tuple(map(lambda n: int(n) - 1, input().split()))

visited = [0] * n
next_town = 0
order = []

while True:
    if visited[next_town]:
        break
    order.append(next_town)
    visited[next_town] = 1
    next_town = a[next_town]

first_loop = len(order)
offset = order.index(next_town)
second_loop = first_loop - offset

if k < first_loop:
    print(order[k] + 1)
else:
    print(order[offset + (k - first_loop) % second_loop] + 1)
### BUGGY CODE ###

nm=list(map(int,input().split()))
lista=[]#壊れている階段の座標
for i in range(nm[1]):
    lista=lista+[int(input())]
i=0#現在地
b1=1#現在地までの行き方
b2=0#現在地のひとつ前までの行き方
while i <nm[0]:
    if i+1 not in lista:
        i+=1
        b1+=b2
        b2=b1-b2
    elif i+1 in lista and i+2 not in lista:
        i+=2
        b2=0
    else:
        i=nm[0]
        b1=0
print(b1%1000000007)

### FIXED CODE ###

nm=list(map(int,input().split()))
stair=[1]*(nm[0]+1)
for i in range(nm[1]):
    stair[int(input())]=0

i=0#現在地
b1=1#現在地までの行き方
b2=0#現在地のひとつ前までの行き方
while i <nm[0]:
    if stair[i+1]==1:
        i+=1
        b1+=b2
        b2=b1-b2
    elif stair[i+1]==0 and stair[i+2]==1:
        i+=2
        b2=0
    else:
        i=nm[0]
        b1=0
print(b1%(10**9+7))
### BUGGY CODE ###

a = list(map(int, input().split()))
b, c = a[0], a[1]
ans = 0
while c > 0:
    if c > 1 and b > 0:
        ans += 1
        b -= 1
        c -= 2
    elif c > 3:
        c -= 4
        ans += 1
    else:
        break

print(ans)

### FIXED CODE ###

a = list(map(int, input().split()))
b, c = a[0], a[1]
ans = min(b, c // 2)
if b > c // 2:
    c = c % 2
else:
    c -= b * 2
b -= min(b, c // 2)
if c > 3:
    ans += c // 4
print(ans)
### BUGGY CODE ###

N, M = map(int, raw_input().split())
A = map(int, raw_input().split())
rewritelist = []
for i in range(0, M):
	rewritelist.append(map(int, raw_input().split()))
A.sort()
rewritelist.sort(key = lambda val: val[1], reverse = True)
cardlist = []
for i in range(0, N):
	if rewritelist == []: break
	cardlist.append(rewritelist[0][1])
	rewritelist[0][0] -= 1
	if rewritelist[0][0] == 0: rewritelist.pop(0)
for i in range(0, len(cardlist)):
	if cardlist[i] <= A[i]: break
	A[i] = cardlist[i]
sum = 0
for i in range(0, N):
	sum += A[i]
print sum

### FIXED CODE ###

def smaller(x, y):
	if x < y: return x
	return y
def larger(x, y):
	if x > y: return x
	return y

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
Asum = []
sum = 0
for i in range(0, N):
	sum += A[i]
	Asum.append(sum)
controllist = []
for i in range(0, M):
	controllist.append(list(map(int, input().split())))
controllist.sort(key = lambda v: v[1], reverse = True)
addlist = []
flag = False
for i in range(0, M):
	for j in range(0, controllist[i][0]):
		addlist.append(controllist[i][1])
		if len(addlist) == N:
			flag = True
			break
	if flag: break
sum = 0
for i in range(0, smaller(N, len(addlist))):
	sum += larger(A[i], addlist[i])
for i in range(len(addlist), N):
	sum += A[i]
print(sum)
### BUGGY CODE ###

from collections import deque
N,M=list(map(int,input().split()))
AB=[set() for i in range(N+1)]
node_list=[None]*(N+1)
class node():
    def __init__(self,i):
        self.node=i
        self.prev=None
def bfs(i):#１に到達
    Done=set()
    Done.add(i)
    d=deque([i])
    count = 1
    a = set()
    a.add(i)
    bro = {0: a}
    second=False
    while(d):

        kako = set()
        k=d.popleft()
        if node_list[k] is None:
            n = node(k)
        else:
            n=node_list[k]
        for i in AB[k]:
            if i not in Done:
                jk=node(i)
                jk.prev=n
                node_list[i]=jk
                kako.add(i)
                Done.add(i)
                d.append(i)
                if i==1:
                    return True,jk

        if k  in bro[count-1]:
            if count not in bro:
                bro[count]=kako
            else:
                bro[count] = bro[count].union(kako)
        else:#入ってなかった場合
            count+=1

            if count not in bro:
                bro[count]=kako
            else:
                bro[count] = bro[count].union(kako)
        node_list[k]=n
    return False,0




for i in range(M):
    A,B=list(map(int,input().split()))
    AB[A].add(B)
    AB[B].add(A)
flag1=True
for i in range(2,N+1):
    flag,jk=bfs(i)
    if flag:
        if flag1:
            print("Yes")
            flag1=False

        while(jk.prev.node!=i):
            jk=jk.prev
        print(jk.node)


### FIXED CODE ###

from collections import deque
N,M=list(map(int,input().split()))
AB=[set() for i in range(N+1)]
room=[0]*(N+1)
pre=[None]*(N+1)
def bfs(i):#１に到達
    Done=set()
    Done.add(i)
    d=deque([i])
    # child=set()
    # child.add(i)
    # count=1
    while(d):
        k=d.popleft()
        # if k not in child:
        #     count+=1
        #     child=child.union(Done)
        # room[k]=count
        for i in AB[k]:
            if i not in Done:
                pre[i]=k
                Done.add(i)
                d.append(i)





for i in range(M):
    A,B=list(map(int,input().split()))
    AB[A].add(B)
    AB[B].add(A)

flag=True
bfs(1)
if pre.count(None)<=N+1:
    for i in range(2,N+1):
        if flag:
            print("Yes")
            flag=False
        if pre[i] is not None:
            print(pre[i])
else:print("No")
### BUGGY CODE ###

# -*- coding: utf-8 -*-

n = int(raw_input())
s = [ raw_input() for i in range(n) ]

x = [ "".join(sorted(i)) for i in s ]
_x = sorted(x)
count = 0
for i in xrange(n-1):
    tmp = _x[i]
    for j in xrange(i+1,n):
        if tmp == _x[j]:
            count += 1
        else:
            break

print(count)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(raw_input())
d = {}
ans = 0
for i in range(n):
    si = ''.join(sorted(raw_input()))
    if si in d:
        ans += d[si]
        d[si] += 1
    else:
        d[si] = 1
print(ans)
### BUGGY CODE ###

import bisect

n = int(input())
color = []
bisect.insort_left(color, int(input()))
for _ in range(n-1):
  key = int(input())
  if key <= color[0]:
    bisect.insort_left(color, key)
  else:
    color[bisect.bisect_left(color, key)-1] = key

print(len(color))

### FIXED CODE ###

n = int(input())

colors = []

for i in range(n):
  a = int(input())
  if i == 0:
    colors.append(a)
    continue
  if colors[-1] >= a:
    colors.append(a)
  elif a > colors[0]:
    colors[0] = a
  else:
    l, r = 0, len(colors)
    while r-l > 1:
      k = (r+l)//2
      if a > colors[k]:
        r = k
      else:
        l = k
    if a > colors[l]:
      colors[l] = a
    else:
      colors[r] = a

print(len(colors))