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

import itertools
from functools import reduce
from operator import mul
n, k = map(int, input().split())
lst = list(map(int, input().split()))
lst2 = list(itertools.combinations(lst, k))
#print(lst2)

anslst = []
for i in range(len(lst2)):
	seki = reduce(mul, lst2[i])
	anslst.append(seki)

#print(anslst)
tei = 10 ** 9 + 7
print(max(anslst) % tei)

### FIXED CODE ###

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


mod=10**9+7

if A[-1]<0 and k%2==1:
    now=1
    for i in range(k):
        now*=A[-i-1]%mod
        now%=mod
    print(now) ;exit()

l=0 ; r=n-1
ans=1
if k%2==1:
    ans=A[-1]
    r-=1

for i in range(k//2):
    mi=A[l]*A[l+1]
    pl=A[r]*A[r-1]
    if mi>pl:
        ans*= mi%mod
        ans%=mod
        l+=2
    else:
        ans*= pl%mod
        ans%=mod
        r-=2
print(ans%mod)
### BUGGY CODE ###

from fractions import gcd
m=10**9+7
n=int(input())
L=list(map(int,input().split()))
g=L[0]
r=1
for i in range(n-1):
    a=L[i+1]//gcd(g,L[i+1])
    g=(g*L[i+1])//gcd(g,L[i+1])
    r=a*r+g//L[i+1]
print(r%m)

### FIXED CODE ###

from collections import defaultdict

n=int(input())
A=list(map(int,input().split()))
MOD=10**9+7
L=defaultdict(int)

def soinsu(n):
	l=defaultdict(int)
	for j in range(2,int(n**0.5)+1):
		while n%j==0:
			l[j]+=1
			n//=j
	if l=={}:
			l[n]+=1
	else:
		if n!=1:
			l[n]+=1
	for k,v in l.items():
		L[k]=max(L[k],v)

for i in range(n):
	soinsu(A[i])

LM=1
for k,v in L.items():
	LM*=k**v
	LM%=MOD

r=0
for i in range(n):
	r+=LM*pow(A[i],MOD-2,MOD)
	r%=MOD
print(r)
### BUGGY CODE ###

import sys
# input = sys.stdin.buffer.readline
def input(): return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)

MAX = 30000   # (80+80)*80=12800
MID = 15000   # 15000を0とする
H, W = map(int, input().split())
A = [[int(x) for x in input().split()] for _ in range(H)]
B = [[int(x) for x in input().split()] for _ in range(H)]
C = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        C[i][j] = abs(A[i][j] - B[i][j])

dp = [[[0]*MAX for _ in range(W)] for _ in range(H)]
dp[0][0][MID+C[0][0]] = 1
dp[0][0][MID-C[0][0]] = 1
for i in range(H):
    for j in range(W):
        if i:
            for k in range(MAX):
                if dp[i-1][j][k] == 1:
                    dp[i][j][k+C[i][j]] = 1
                    dp[i][j][k-C[i][j]] = 1
        if j:
            for k in range(MAX):
                if dp[i][j-1][k] == 1:
                    dp[i][j][k+C[i][j]] = 1
                    dp[i][j][k-C[i][j]] = 1
ans = MAX
for i in range(MAX):
    if dp[H-1][W-1][i] == 1:
        ans = min(ans, abs(i-MID))
print(ans)

### FIXED CODE ###

H, W = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]
B = [list(map(int, input().split())) for i in range(H)]
center = 80 * (H+W)
C = [[abs(A[i][j] - B[i][j]) for j in range(W)] for i in range(H)]

dp = [[0] * W for i in range(H)]
dp[0][0] = (1 << (center + C[0][0])) | (1 >> (center - C[0][0]))

for i in range(H):
    for j in range(W):
        if i:
            dp[i][j] |= dp[i-1][j] << C[i][j]
            dp[i][j] |= dp[i-1][j] >> C[i][j]
        if j:
            dp[i][j] |= dp[i][j-1] << C[i][j]
            dp[i][j] |= dp[i][j-1] >> C[i][j]

ans = center * 2
for i in range(center*2):
    if (dp[H-1][W-1] >> i) & 1:
        ans = min(ans, abs(i-center))

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

def main():

	nbOperation = 0

	sentenceS = input()
	sentenceToT = input()

	for i in range(len(sentenceS)):
		if sentenceS[i] != sentenceToT[i]:
			convertisseur = list(sentenceS)
			convertisseur[i] = sentenceToT[i]
			nbOperation += 1
			sentenceS = "".join(convertisseur)

	print(nbOperation)

main()

### FIXED CODE ###

def main():

	nbOperation = 0

	sentenceS = list(input())
	sentenceToT = input()

	for i in range(len(sentenceS)):
		if sentenceS[i] != sentenceToT[i]:
			
			sentenceS[i] = sentenceToT[i]
			nbOperation += 1
			

	print(nbOperation)

main()
### BUGGY CODE ###

s = input()
q = int(input())

trans = False
for i in range(q):
    query = input().split()
    if(query[0] == '1'):
        trans = not trans            
    else:
        if(trans):
            if(query[1] == '1'):
                s = s + query[2]
            else:
                s = query[2] + s
        else:
            if(query[1] == '1'):
                s = query[2] + s
            else:
                s = s + query[2]

if(trans):
    s = s[::-1]
print(s)

### FIXED CODE ###

s = input()
q = int(input())

trans = False
s2 = ''
for i in range(q):
    query = input().split()
    if(query[0] == '1'):
        trans = not trans
    else:
        if(trans):
            if(query[1] == '1'):
                s = s + query[2]
            else:
                s2 = s2 + query[2]
        else:
            if(query[1] == '1'):
                s2 = s2 + query[2]
            else:
                s = s + query[2]

s2 = s2[::-1]
s = s2 + s
if(trans):
    s = s[::-1]
print(s)
### BUGGY CODE ###

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

dist = dict()
i = 0
s = 0
while True :
    cur = i % N
    if cur in dist :
        d1 = dist[cur][1]
        d2 = i - d1
        break
    
    i += 1
    while A[i%N] != A[cur] :
        i += 1
    
    i += 1
    dist[cur] = (i%N, s)
    s = i

if N*K > d1 :
    m = (N*K - d1) % d2
    while m > dist[dist[cur][0]][1] - d1 :
        cur = dist[cur][0]
    m -= dist[cur][1] - d1
else :
    m = 0
  
ret = []
for a in A[-m:] :
    if a in ret :
        ret = ret[:ret.index(a)]
    else :
        ret.append(a)
        
print(' '.join([str(i) for i in ret]))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, K = map(int, input().split())
A = [int(i) for i in input().split()]

last = dict()
v = [-1] * N

for i, a in enumerate(A + A) :
    if a in last and last[a] < N :
        v[last[a]] = i + 1
    
    last[a] = i

dist = [-1] * N
cur = 0
cycle = 0
while dist[cur] < 0 :
    dist[cur] = cycle 
    cycle += v[cur] - cur
    cur = v[cur] % N

NK = N * K

m = NK % cycle
cur = v[cur] % N
s = 0
while m > dist[cur] > 0 :
    s = dist[cur]
    cur = v[cur] % N
m -= s

ret = []
seen = set()
for a in A[N-m:] :
    if a in seen :
        p = ret.pop()
        seen.remove(a)
        while p != a :
            seen.remove(p)
            p = ret.pop()
    else :
        ret.append(a)
        seen.add(a)
        
print(' '.join([str(i) for i in ret]))
### BUGGY CODE ###

def chmin(a,b):
    if a>b: return b
    else: return a

def chmax(a,b):
    if a>b: return a
    else: return b

def main():
    N,K = map(int, input().split())
    h = list(map(int, input().split()))
    # 初期化
    # 初期条件
    # ループ
    # テーブルから解を得る
    INF = float('inf')
    dp = [INF] * N
    dp[0] = 0
    for i in range(N-1):
        for j in range(1, min(K+1, N-i)):
            dp[i+j] = chmin(dp[i+j], dp[i]+abs(h[i+j]-h[i]))
    print(dp[-1])

main()


### FIXED CODE ###

def main():
    N,K = map(int, input().split())
    h = list(map(int, input().split()))
    # 初期化
    # 初期条件
    # ループ
    # テーブルから解を得る
    INF = float('inf')
    dp = [INF] * N
    dp[0] = 0
    for i in range(N-1):
        for j in range(1, min(K+1, N-i)):
            dp[i+j] = min(dp[i+j], dp[i]+abs(h[i+j]-h[i]))
    print(dp[-1])

main()
### BUGGY CODE ###

import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    s = S()
    q = I()
    lst = collections.deque(list(s))
    state = False

    for _ in range(q):
        query = LS()
        if len(query) == 1:
            state = not state
        else:
            if state:
                if query[1] == "1":
                    lst.append(query[2])
                else:
                    lst.appendleft(query[2])
            else:
                if query[1] == "1":
                    lst.appendleft(query[2])
                else:
                    lst.append(query[2])
    ans = ""
    if state:
        for _ in range(len(lst)):
            ans += lst.pop()
    else:
        ans = "".join(lst)

    print(ans)
main()            


### FIXED CODE ###

import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    s = S()
    q = I()
    lst = collections.deque(list(s))
    state = False

    for _ in range(q):
        query = LS()
        if len(query) == 1:
            state = not state
        else:
            if state:
                if query[1] == "1":
                    lst.append(query[2])
                else:
                    lst.appendleft(query[2])
            else:
                if query[1] == "1":
                    lst.appendleft(query[2])
                else:
                    lst.append(query[2])
    ans = ""
    if state:
        for _ in range(len(lst)):
            ans += lst.pop()
    else:
        ans = "".join(lst)

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

N = input()
X = map(int, raw_input().split())
pair = [(v, i) for i, v in enumerate(X)]
pair.sort()
X.sort()
res = {}
for i, v in enumerate(pair):
    key = v[1]
    val = v[0]
    res[key] = (X[:i] + X[i + 1:])[(N - 1) / 2]
for i in range(N):
    print res[i]


### FIXED CODE ###

N = input()
X = map(int, raw_input().split())
med = sorted(X)[N / 2 - 1:N / 2 + 1]
for v in X:
    if v <= med[0]:
        print med[1]
    else:
        print med[0]
### BUGGY CODE ###

h, w, n = map(int, input().split())
blacks = [[0 for _ in range(w - 2)] for _ in range (h - 2)]
for _ in range(n):
    a, b = map(int, input().split())
    for p in range(max(0, a - 3), min(a, h - 2)):
        for q in range(max(0, b - 3), min(b, w - 2)):
            blacks[p][q] += 1
count = [0 for _ in range(10)]
for k in range(h - 2):
    for l in range(w -2):
        count[blacks[k][l]] += 1
for i in range(10):
    print(count[i])


### FIXED CODE ###

from collections import Counter, defaultdict

h, w, n = map(int, input().split())
hs, ws = h - 2, w - 2
dd = defaultdict(int)

for a, b in (map(int, input().split()) for _ in range(n)):
    for y in range(max(0, a - 3), min(a, hs)):
        for x in range(max(0, b - 3), min(b, ws)):
            dd[(y, x)] += 1

print(hs * ws - len(dd))

c = Counter(dd.values())
for i in range(1, 10):
    print(c[i] if i in c else 0)
### BUGGY CODE ###

def main():
	N, M = [int(x) for x in input().split(" ")]
	route = [[] for i in range(N)]
	for i in range(M):
		A, B = [int(y) for y in input().split(" ")]
		route[A - 1] += [B]
		route[B - 1] += [A]

	checked = [1] + [0] * (N - 1)
	to_check = [{"src" : s, "dst" : 1} for s in route[0]]
	signal = [-1] + [0] * (N - 1)
	signal_cnt = 0

	while len(to_check) > 0:
		checking = to_check.pop(0)
		src = checking["src"]
		if checked[src - 1] == 0:
			checked[src - 1] = 1
			signal[src - 1] = str(checking["dst"])
			signal_cnt += 1
			rooms = route[src - 1]
			for r in rooms:
				if checked[r - 1] == 0:
					to_check.append({"src": r, "dst": src})
	if signal_cnt != N - 1:
		print("No")
	else:
		print("Yes")
		print("\n".join(signal[1:]))

main()

### FIXED CODE ###

def main():
	N, M = [int(x) for x in input().split(" ")]
	route = [[] for i in range(N)]
	for i in range(M):
		A, B = [int(y) for y in input().split(" ")]
		route[A - 1] += [B]
		route[B - 1] += [A]

	checked = [1] + [0] * (N - 1)
	to_check = [{"src" : s, "dst" : 1} for s in route[0]]
	signal = [-1] + [0] * (N - 1)

	for r in route[0]:
		checked[r - 1] = 1

	while len(to_check) > 0:
		checking = to_check.pop(0)
		src = checking["src"]
		signal[src - 1] = str(checking["dst"])
		rooms = route[src - 1]
		for r in rooms:
			if checked[r - 1] == 0:
				to_check.append({"src": r, "dst": src})
				checked[r - 1] = 1

	if signal.count(0) > 0:
		print("No")
	else:
		print("Yes")
		print("\n".join(signal[1:]))

main()
### BUGGY CODE ###

K=int(input())
import math
count=0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            d=math.gcd(a,b)
            count+=math.gcd(c,d)
print(count)

### FIXED CODE ###

K=int(input())
import math
count=0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            d=math.gcd(a,b)
            count+=math.gcd(c,d)
print(count)
### BUGGY CODE ###

N,A,B=map(int,input().split())
count=0
for i in range(N):
    k=i%(A+B)
    if k<A:
        count+=1
print(count)

### FIXED CODE ###

N,A,B=map(int,input().split())
count=0
k=N%(A+B)
add=0
if k<A:
    add=k
else:
    add=A
print(N//(A+B)*A+add)
### BUGGY CODE ###

X, K, D = map(int, input().split())
if abs(X) > D * K:
    abso = abs(X) - D * K
    print(abso)
    exit()
abso = abs(X)
mini = abs(X)
g = abs(X)
for i in range(K):
    abso =abs(abso - D)
    if abso < mini:
        mini = abso
print(abso)


### FIXED CODE ###

X, K, D = map(int, input().split())
if abs(X) > D * K:
    abso = abs(X) - D * K
    print(abso)
    exit()
div = abs(X)//D
mod = abs(X)%D #+側の最小値
if (K - div)%2 == 0: #K-div:+側での絶対値の最小値までたどり着く回数
    print(mod)
else:
    print(D-mod)
### BUGGY CODE ###

def main():
    N = int(input())
    M = [str(i) for i in range(1,N+1)]
    ans = 0

    for i in M:
        ans += len(list([s for s in M if s.startswith(i[-1]) and s.endswith(i[0])]))

    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np

def main():
    N = np.array([str(i) for i in range(1,int(input())+1)])
    C = np.zeros((10,10), dtype=np.int)
    ans = 0

    # C[i][j](0 <= i,j <= 9)のテーブルを構築する: O(N)
    for n in N:
        C[int(n[0])][int(n[-1])] += 1

    for i in range(1,9+1):
        for j in range(1,9+1):
            ans += C[i][j] * C[j][i]

    print(ans)

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

K,S = map(int, input().split())

ans = 0
if K*3<S:
  print(0)
  exit()

for x in range(K, -1, -1):
  if x >S:
    continue
  for y in range(min(S-x, K), -1, -1):
    if x+y >S:
      continue
    for z in range(min(S-x-y, K), -1, -1):
      if x+y+z==S:
        ans+=1
      elif x+y+z<S:
        break

print(ans)

### FIXED CODE ###

K,S = map(int, input().split())

ans = 0
if K*3<S:
  print(0)
  exit()

for x in range(K, -1, -1):
  if x >S:
    continue
  for y in range(min(S-x, K), -1, -1):
    if x+y >S:
      continue
    for z in range(min(S-x-y, K), -1, -1):
      if x+y+z==S:
        ans+=1
      elif x+y+z<S:
        break

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

N, X, Y = map(int, input().split())
X -= 1
Y -= 1
K = [0 for i in range(N)]

for i in range(N-1):
    for j in range(i+1, N):
        a = abs(j - i)
        b = abs(X - i) + 1 + abs(j - Y)
        c = abs(Y - i) + 1 + abs(j - X)
        K[min(a, b, c)] += 1

for i in range(1, N):
    print(K[i])


### FIXED CODE ###

N, X, Y = map(int, input().split())
X -= 1
Y -= 1
K = [0] * N

for i in range(N-1):
    for j in range(i+1, N):
        a = abs(j - i)
        b = abs(X - i) + 1 + abs(j - Y)
        c = abs(Y - i) + 1 + abs(j - X)
        K[min(a, b, c)] += 1

for i in range(1, N):
    print(K[i])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n, q = map(int, input().split())
vals = [0] * n
node_idxes = [[] for _ in range(n)]

for i in range(n - 1):
	a, b = map(int, input().split())
	node_idxes[a - 1].append(b - 1)
	node_idxes[b - 1].append(a - 1)

for i in range(q):
	p, x = map(int, input().split())
	vals[p - 1] += x

def dfs(chi_idx, parent):
	for child in node_idxes[chi_idx]:
		if child == parent:
			continue
		vals[child] += vals[chi_idx]
		dfs(child, chi_idx)

dfs(0, -1)
print(*vals)


### FIXED CODE ###

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

n, q = map(int, input().split())
vals = [0] * n
node_idxes = [[] for _ in range(n)]

for i in range(n - 1):
	a, b = map(int, input().split())
	node_idxes[a - 1].append(b - 1)
	node_idxes[b - 1].append(a - 1)

for i in range(q):
	p, x = map(int, input().split())
	vals[p - 1] += x

def dfs(chi_idx, parent):
	for child in node_idxes[chi_idx]:
		if child == parent:
			continue
		vals[child] += vals[chi_idx]
		dfs(child, chi_idx)

dfs(0, -1)
print(*vals)
### BUGGY CODE ###

N = int(input())
S = input()
num = [0 for _ in range(N)]

for i in range(N):
  for j in range(i):
    if S[j] == 'W':
      num[i] += 1
  for j in range(i+1, N):
    if S[j] == 'E':
      num[i] += 1

print(min(num))

### FIXED CODE ###

N = int(input())
S = input()
num = [0 for _ in range(N)]

for i in range(1, N):
  if S[i] == 'E':
    num[0] += 1

for i in range(1, N):
  diff = 0
  if S[i-1] == 'W':
    diff += 1
  if S[i] == 'E':
    diff -= 1
  num[i] = num[i-1] + diff
  
print(min(num))
### BUGGY CODE ###

N, K = map(int, input().split())
A_list = list(map(int, input().split()))
Score_list = [1 for i in range(N+1)]

for i in range(K, N+1):
    # print(sum(A_list[0:i]))
    #
    # Score_list[i] = sum(A_list[0:i])
    # Score_list[i] = 1
    for j in range(i-K, i):
        Score_list[i] *= A_list[j]
    if i > K:
        if Score_list[i] > Score_list[i-1]:
            print("Yes")
        else:
            print("No")

# print(Score_list)


### FIXED CODE ###

# import decimal
import time
time1 = time.time()

N, K = map(int, input().split())
# N = 200000
# K = 50000
A_list = list(map(int, input().split()))
# A_list = [2 for i in range(N)]
# Score_list = [1 for i in range(N+1)]

for i in range(K+1, N+1): #KからNの数字が入る
    # print(i-1)
    # print(i-2-K)
    if A_list[i-1] > A_list[i-1-K]:
        print("Yes")
    else:
        print("No")
    # if i == K:
    #     S = 1
    #     for j in range(i-K, i):
    #         S *= A_list[j]
    #     Score_list[i] = S
    # else:
    #     Score_list[i] = int(Score_list[i-1] / A_list[i-1-K])
    #     Score_list[i] *= A_list[i-1]
    # if i > K:
    #     if Score_list[i] > Score_list[i-1]:
    #         print("Yes")
    #     else:
    #         print("No")
    # # print(Score_list)

# print(Score_list)
time2 = time.time()
# print(time2-time1)
### BUGGY CODE ###

import math
K = int(input())
S = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      S += math.gcd(math.gcd(a, b), c)
print(S)

### FIXED CODE ###

import math
K = int(input())
S = 0
for a in range(1, K+1):
  for b in range(1, K+1):
    g = math.gcd(a, b)
    for c in range(1, K+1):
      S += math.gcd(g, c)
print(S)
### BUGGY CODE ###

import itertools
n = int(input())
l = list(map(int, input().split()))
ans = 0
gr = itertools.groupby(l)
check = list(itertools.combinations(l, 3))
for i in range(len(check)):
    if 2 * max(check[i]) - sum(check[i]) < 0:
        ans += 1
print(ans)


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
A = sorted(A)
ans = 0


def q(k):
    if A[k] < A[i] + A[j]:
        return True
    else:
        return False


for i in range(n):
    for j in range(i + 1, n):
        l = j
        r = n
        while r - l > 1:
            mid = (l + r) // 2
            if q(mid):
                l = mid
            else:
                r = mid
        ans += (l - j)


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

n,k=map(int,input().split())
p=list(map(int,input().split()))
a=0
b=[]
for i in range(n-k+1):
  if a<sum(p[i:i+k]):
    a=sum(p[i:i+k])
    b=p[i:i+k]
c=list(map(lambda x: x/2+0.5, b))
print(sum(c))

### FIXED CODE ###

n,k=map(int, input().split())
p=list(map(int, input().split()))
import numpy as np
a=np.array(p)/2+0.5
s=a[:k].sum()
m=s
for i in range(1,n-k+1):
    s=s-a[i-1]+a[i+k-1]
    if s>m:
        m=s
print(m)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
#print(A)
minA = A[0]
Query = []
for _ in range(m):
    b,c = map(int,input().split())
    if c > minA:
        Query.append([b,c])
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)
ans = 0
for b,c in Query:
    A.sort()
    if A[0] >= c:
        break
    else:
        index = min(bisect.bisect_left(A,c),b)
        A = [c for _ in range(index)]+ A[index:]
    #print(A)
print(sum(A))

### FIXED CODE ###

import sys
input = sys.stdin.readline
import bisect
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()

minA = A[0]
Query = []
for _ in range(m):
    b,c = map(int,input().split())
    if c > minA:
        Query.append([b,c])
Query = sorted(Query, key=lambda x:(x[1], x[0]), reverse=True)

ans = 0
index = 0
for b,c in Query:
    if index >= n:
        break
    #print("----")
    cnt = 0
    Flag = True
    while Flag:
        #print(A,b,c,index)
        if A[index] < c:
            A[index] = c
            cnt += 1
            index += 1
            if (cnt >= b) or (index >= n):
                Flag = False
        else:
            Flag = False
    '''
    #A.sort()
    if A[0] >= c:
        break
    else:
        index = min(bisect.bisect_left(A,c),b)
        if index > len(A):
            ans += c * len(A)
            break
        else:
            ans += c * index
            A = A[index:]
    print(A)
    '''
print(sum(A))
### BUGGY CODE ###

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N,M = map(int,input().split())
count = [[0]*N for _ in range(N)]
fr = [[]*N for _ in range(N)]
for _ in range(M):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    if count[a][b] == 1:
        continue
    count[a][b] = 1
    count[b][a] = 1
    fr[a].append(b)
    fr[b].append(a)
used = [-1]*N #-1なら未探索。数字はrenketuのindex
renketu = []
index = 0
def dfs(fr,cur,parent,index,li):
    children = fr[cur]
    for chi in children:
        if chi == parent or used[chi] != -1:
            continue
        used[chi] = index
        li.append(chi)
        dfs(fr,chi,cur,index,li)
for i in range(N):
    if used[i] != -1:
        continue
    li = [i]
    used[i] = index
    dfs(fr,i,-1,index,li)
    index += 1
    renketu.append(li)
n = len(renketu)
MAX = 0
for i in range(n):
    lii = renketu[i]
    MAX = max(len(lii),MAX)
print(MAX)

            








### FIXED CODE ###

import sys
sys.setrecursionlimit(99999999)


[n,m]=list(map(int,input().split()))
friends=[]
for i in range(m):
    friends.append(list(map(int,input().split())))

tomodachi=[[]for i in range(n)]

for i in range(m):
    tomodachi[friends[i][0]-1].append(friends[i][1]-1)
    tomodachi[friends[i][1]-1].append(friends[i][0]-1)

for i in range(n):
    tomodachi[i]=list(set(tomodachi[i]))

namelist=[1 for i in range(n)]
teams=[]

def haba(x,kari,tomodachi,namelist):
    for i in range(len(tomodachi[x])):
        if namelist[tomodachi[x][i]]==1:#生き残っているなら
            kari.append(tomodachi[x][i])
            namelist[tomodachi[x][i]]=0#殺す
            haba(tomodachi[x][i],kari,tomodachi,namelist)
    return(kari)
            


for i in range(n):
    if namelist[i]==1:
        teams.append(list(set(haba(i,[i],tomodachi,namelist))))

saidai=0

for i in range(len(teams)):
    if saidai<len(teams[i]):
        saidai=len(teams[i])

ans=saidai

print(ans)