Harryxun/stf_run huggingface dataset:
from math import factorial
import sys

sys.setrecursionlimit(2000)
n, k = map(int, input().split())

memo = {}
def combination(n,k):
  if (n,k) in memo:
    return memo[(n,k)]
  elif n < k:
    return memo.setdefault((n,k), 0)
  elif k == 0:
    return memo.setdefault((n,k), 1)
  elif k == 1:
    return memo.setdefault((n,k), n)
  else:
  	return memo.setdefault((n,k), combination(n-1,k) + combination(n-1,k-1))

for i in range(1, k + 1):
  print(combination(n-k+1,i)*combination(k-1,i-1)%(10**9+7))


### FIXED CODE ###

from math import factorial
import sys

sys.setrecursionlimit(2000)
mod = 10**9+7
n, k = map(int, input().split())

memo = {}
def combination(n,k):
  if n < k:
    return 0
  return factorial(n)//factorial(k)//factorial(n-k)
  if n / 2 < k:
    k = n - k
  if n in memo and k in memo[n]:
    return memo[n][k]
  v = 0
  if k == 0:
    v = 1
  elif k == 1:
    v = n
  else:
    v = combination(n-1,k) + combination(n-1,k-1)
  return memo.setdefault(n, {}).setdefault(k, v)

for i in range(1, k + 1):
  print(combination(n-k+1,i)*combination(k-1,i-1)%mod)
import itertools as it

n,m=map(int,input().split())
ans=[]
for i in range(n):
    a,b=map(int,input().split())
    ans.append([a,b])
    ans.append([b,a])
  
a=0
for e in it.permutations(range(n)):
    count=0
    if e[0]!=0:
        break
    
    for i in range(len(e)-1):
        if [e[i]+1,e[i+1]+1] in ans:
            count=1
        else:
            count*=0
            
    a+=count
    
print(a)

### FIXED CODE ###

import itertools as it
import sys

N, M = map(int, input().split())
if N==0 or M==0:
    print(0)
    sys.exit()
a=[]

for i in range(M):
    x,y=map(int,input().split())
    a.append([x,y])
    a.append([y,x])

ans=0
for e in it.permutations(range(N)):
    if e[0]!=0:
        break
        
    count=1
    for j in range(N-1):
        if [e[j]+1,e[j+1]+1] in a:
            count*=1
        else:
            count*=0
            break
            
    ans+=count

print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
ans = 0
for i in range(n-k+1):
    x = 0
    for j in p[i:i+k]:
        z = 0
        for a in range(1,j+1):
            z+=a*(1/j)
        x+=z
    ans = max(x,ans)
print(ans)

### FIXED CODE ###

import collections
s = int(input())
a = list(map(str, input().split()))
n = {}
for i in a:
  n.setdefault(i, 0)
for i in a:
  n[i] += 1
x = 0
for i in n.values():
  if x <= i:
    x = i
if x == 1:
  print("YES")
else:
  print("NO")
def main():
    N = int(input())
    ans = ""

    while N > 26:
        tmp = N % 26
        txt = "z" if tmp == 0 else chr(tmp + 96)
        # if tmp == 0:
        #     ans += "z"
        # else:
        #     ans += chr(tmp + 96)
        ans += txt
        # print(f"{ans = }. {N = }")
        N //= 26
    else:
        txt = "z" if tmp == 0 else chr(tmp + 96)
        ans += txt

    print(ans[::-1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    ans = ""

    while N:
        N -= 1
        tmp = N % 26
        ans += chr(tmp + ord("a"))
        N //= 26

    print(ans[::-1])


if __name__ == '__main__':
    main()
Ss = []
for i in range(N):
	Ss.append(input())
	
C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
	if S == 'AC':
		C0 += 1
	elif S == 'WA':
		C1 += 1
	elif S == 'TLE':
		C2 += 1
	else:
		C3 += 1
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))

### FIXED CODE ###

N = int(input())
Ss = []
for i in range(N):
	Ss.append(input())
	
C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
	if S == 'AC':
		C0 += 1
	elif S == 'WA':
		C1 += 1
	elif S == 'TLE':
		C2 += 1
	else:
		C3 += 1
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))
n=str(input())
a=0
for i in range(len(n)):
	if int(n[i])==7:
		a=1
        break
if a==1:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n=str(input())
a=0
for i in range(len(n)):
    if int(n[i])==7:
        a=1
        break
if a==1:
  print('Yes')
else:
  print('No')
ciar = input().split()
W,H,x,y,r = [ciar[0],ciar[1],ciar[2],ciar[3],ciar[4]]
if x + r <= W and y - r >= 0 and x - r >= 0 and y + r <= H:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

ciar = input().split()
W = int(ciar[0])
H = int(ciar[1])
x = int(ciar[2])
y = int(ciar[3])
r = int(ciar[4])
if (x + r) <= W and (x - r) >= 0 :
    if (y + r) <= H and (y - r) >= 0 :
        print("Yes")
    else :
        print("No")
else :
    print("No")
while 1:
	e = ans = input()
	if e == 0: break
	for z in range(e):
	    z3 = z**3
		if z3 > e: break
		y = int((e-z3)**0.5)
		ans = min(ans,e+y+z-y**2-z3)
	print ans

### FIXED CODE ###

while 1:
	e = ans = input()
	if e == 0: break
	for z in range(e):
		z3 = z**3
		if z3 > e: break
		y = int((e-z3)**0.5)
		ans = min(ans,e+y+z-y**2-z3)
	print ans
while True:
		num = raw_input().split(" ")
		sum = 0
		x = float(num[0]) / float(num[1])
		if x < 1:
			x = x + 1.0
		for var in range(1, int(num[2]) + 1):
			sum += int(str(x * 10**var)[var:var+1])
			
		print sum

### FIXED CODE ###

while True:
	try:
		a,b,n = map(int,raw_input().split())
	except EOFError:
		break
	s = 0
	for var in range(0, n):
		a = a % b * 10
		s += a / b
	print s
a = int(input())
b = int(input())

if a*b % 2 == 0:
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
if a*b % 2 == 0 :
  print("Even")
else:
  print("Odd")
n = int(input())
a = list(map(int,input().split()))
if a.index(0) >= 0:
    print(0)
    exit()
ret = 1
for a_ in a:
    ret *= a_
    if ret > 10**18:
        print(-1)
        exit()
print(ret)



### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
if 0 in a:
    print(0)
    exit()
ret = 1
for a_ in a:
    ret *= a_
    if ret > 10**18:
        print(-1)
        exit()
print(ret)
n, w = [ int(v) for v in input().split() ]
knapsack = [ [ int(v) for v in input().split() ] for i in range(n) ]

dp_list = [ [ None for i in range(4*n+1) ] for i in range(n+1) ]
dp_list[0][0] = 0
base = knapsack[0][0]


for wi, vi in knapsack:
    wi -= base
    for i in range(n-1,-1,-1):
        for j in range(4*n,-1,-1):
            if 0 <= j-wi < 4*n+1 and 0 <= j < 4*n+1:
                if dp_list[i][j-wi] is not None:
                    if dp_list[i+1][j] is None:
                        dp_list[i+1][j] = dp_list[i][j-wi] + vi
                    else:
                        dp_list[i+1][j] = max(dp_list[i][j-wi] + vi, dp_list[i+1][j])

ans_list = [0]
for i in range(1,n+1):
    l = w - i*base
    for j in range(l+1):
        if dp_list[i][j] is not None:
            ans_list.append(dp_list[i][j])


print(max(ans_list))

### FIXED CODE ###

n, w = [ int(v) for v in input().split() ]
knapsack = [ [ int(v) for v in input().split() ] for i in range(n) ]

dp_list = [ [ None for i in range(4*n+1) ] for i in range(n+1) ]
dp_list[0][0] = 0
base = knapsack[0][0]


for wi, vi in knapsack:
    wi -= base
    for i in range(n-1,-1,-1):
        for j in range(4*n,-1,-1):
            if 0 <= j-wi < 4*n+1 and 0 <= j < 4*n+1:
                if dp_list[i][j-wi] is not None:
                    if dp_list[i+1][j] is None:
                        dp_list[i+1][j] = dp_list[i][j-wi] + vi
                    else:
                        dp_list[i+1][j] = max(dp_list[i][j-wi] + vi, dp_list[i+1][j])

ans_list = [0]
for i in range(1,n+1):
    l = w - i*base
    for j in range(min(4*n+1,l+1)):
        if dp_list[i][j] is not None:
            ans_list.append(dp_list[i][j])


print(max(ans_list))
A, B = map(int, input())
print('Possible' if A+B%3==0 else 'Impossible')

### FIXED CODE ###

def func(a, b):
    result = 'Possible' if (a + b) % 3 == 0 or a % 3 == 0 or b % 3 == 0 else 'Impossible'
    return result

A, B = map(int, input().split())

print(func(A, B))
# import sys
# s = input()
# n = len(s)

# if n < 4:
#     print(0)
#     sys.exit()

# ans = 0
# for i in range(n-3):
#     for j in range(i+3, n):
#         a = int(s[i:j+1])
#         # print(i, j, a, a%2019)
#         if a % 2019 == 0:
#             ans += 1
#             print(a)
# print(ans)

# count = 0
# s = input()
# a = int(s) // 2019
# print(a)
# for i in range(a):
#     if str(i*2019) in s:
#         print(str(i*2019))
#         count += 1
# print(count)

import sys
s = input()
n = len(s)
import numpy as np
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

res = [int(s[a:])%2019 for a in range(n)]
num, count = np.unique(res, return_counts=True)
ans = 0
for n, a in zip(num, count):
    if n == 0:
        ans += a
    else:
        if a > 1:
            ans += combinations_count(a, 2)
print(ans)

### FIXED CODE ###

s = input()[::-1]

sum_of_digits = 0

cnts = [0] * 2019

cnts[0] = 1

d = 1

for c in s:
    sum_of_digits += int(c) * d
    sum_of_digits %= 2019
    d *= 10
    d %= 2019
    cnts[sum_of_digits] += 1

ans = 0
    
for cnt in cnts:
    ans += cnt * (cnt - 1) // 2

print(ans)
n = input()
amari = n//10
p = ''
if amari ==2 or amari ==4 or amari ==5 or amari ==7 or amari ==9:
    p = 'hon'
elif amari ==1 or amari ==0 or amari ==6 or amari ==8 :
    p = 'pon'
else:
    p = 'bon'
print(p)

### FIXED CODE ###

n = int(input())
amari = n%10
p = ''
if amari ==2 or amari ==4 or amari ==5 or amari ==7 or amari ==9:
    p = 'hon'
elif amari ==1 or amari ==0 or amari ==6 or amari ==8 :
    p = 'pon'
else:
    p = 'bon'
print(p)
k = input()
s = input()
i = 0
list = []
l = int(k)

while i < l:
    list.append(s[i])
    i = i + 1

print(list)

### FIXED CODE ###

k = input()
s = input()
i = 0
l = int(k)
p = str()
 
while i < l and len(s) > l:
    p = p + s[i]
    i = i + 1
while i < len(s) and len(s) <=l:
    p = p + s[i]
    i = i + 1
if len(s) > l:
	print(p + '...')
else:
	print(p)
from collections import defaultdict

n, m = [int(i) for i in raw_input().split()]

parents = defaultdict(list)

for _ in range(m):
    u, v = [int(x) for x in raw_input().split()]
    parents[v-1].append(u-1)

def calc_c(parents, f, i):
    if f[i] != -1:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], calc_c(parents, f, v)+1)

    return f[i]

f = [-1] * n
for i in range(n):
    calc_c(parents, f, i)

print max(f)

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(1000000)

n, m = [int(i) for i in raw_input().split()]
parents = defaultdict(list)

i = 0
while i < m:
    u, v = [int(x) for x in raw_input().split()]
    parents[v-1].append(u-1)
    i += 1

def calc_f(parents, f, i):
    if i < 0 or i >= len(f):
        return 0

    if f[i] != -1:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], calc_f(parents, f, v)+1)

    return f[i]

f = [-1] * n
j = 0
while j < n:
    calc_f(parents, f, j)
    j += 1

if len(f) == 0:
    print 0
else:
    print max(f)
# -*- coding: utf-8 -*-

import sys, re
from collections import deque, defaultdict, Counter
from math import gcd, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, initial=1)
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, X = MAP()
aN = LIST()

aN.sort()
sm = sum(aN)
if sm < X:
    print(N-1)
elif sm == X:
    print(N)
else:
    x = X
    for i in range(N):
        x -= aN[i]
        if x < 0:
            print(i)
            exit()


### FIXED CODE ###

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

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, initial=1)
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, X = MAP()
aN = LIST()

aN.sort()
sm = sum(aN)
if sm < X:
    print(N-1)
elif sm == X:
    print(N)
else:
    x = X
    for i in range(N):
        x -= aN[i]
        if x < 0:
            print(i)
            exit()
N, K = list(map(int, input().split()))
S = list(map(int, input().split()))

happy = 0
for i in range(N-1):
  if S[i] == S[i+1]:
    happy += 1
return min([N-1, happy + 2 * K])

### FIXED CODE ###

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

happy = 0
for i in range(N-1):
  if S[i] == S[i+1]:
    happy += 1
print(min([N-1, happy + 2 * K]))
a=int(input())
b=int(input())
c=list(1,2,3)
c.pop(a)
c.pop(b)
print(c[0])

### FIXED CODE ###

a=int(input())
b=int(input())
c=[1,2,3]
c.pop(c.index(a))
c.pop(c.index(b))
print(c[0])
import math
s = input()
k = int(input())

i = 0
while i < len(s):
    if math.log(int(s[i])) * (500 * 10 **12 - 1) > math.log(k):
#         print(i, s[i], int(s[i]) ** (500 * 10 *12))
        break
    i += 1
print(s[i])

### FIXED CODE ###

s = input()
k = int(input())
if len(s) == 1 or k == 1:
    print(s[0])
else:
    i = 0
    while i < k - 1 and i < len(s):
        if s[i] != '1':
            break
        i += 1
    print(s[i])
N, M, K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a, b=[0], [0]
for　i　in　range(N):
  a.append(a[i]+A[i])
for　i　in　range(M):
  b.append(b[i]+B[i])
ans, j=0, M
for　i in range(N+1):
  if a[i]>K:
    break
  while b[j]>K-a[i]:
    j-=117ans=max(ans, i+j)
print(ans)

### FIXED CODE ###

N, M, K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a, b=[0], [0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
ans, j=0, M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    ans=max(ans, i+j)
print(ans)
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
score = {"r":P, "s":R, "p":S} 
m = {"r":"p", "s":"r", "p":"s"}
command= []
mm = []
ans = 0

for i, t in enumerate(T):
    if t == "r":
      c = "p"
      point = P
    elif t == "s":
      cc ="r" 
      point = R
    elif t == "p":
      c = "s"
      point = P
    
    if (i - K >= 0) and (c[i - K] == c):
        c = ''
        point = 0
    
    ans += point
    command.append(c)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())


ans = 0
commands = [''] * N
for i, t in enumerate(T):
    if t == 'r':
        command = 'p'
        point = P

    elif t == 's':
        command = 'r'
        point = R

    elif t == 'p':
        command = 's'
        point = S

    if (i - K >= 0) and (commands[i -  K] == command):
        command = ''
        point = 0

    ans += point
    commands[i] = command

print(ans)
n = int(input())
mochi = [int(input()) for i in range(n)]
mochi.sort(reverse=True)

size = 0
max = 9999999999

for m in mochi:
    # print(m)
    if m < max:
        size += 1
        max = m
# 出力
print(size)


### FIXED CODE ###

# -*- coding: utf-8 -*-
date = input()
# 出力
print("2018", date[4:], sep="")
arr = list(map(int,input()))
print(int(arr[0]*arr[1]*0.5))


### FIXED CODE ###

arr = list(map(int,input().split()))
print(int(arr[0]*arr[1]*0.5))
N, H, W = map(int, input().split())
A = []
B = []
counter = 0
for i in range(0,N):
    a,b  = map(int, input().split())
    if a=>H and b=>W:
        counter +=1
print(counter)

### FIXED CODE ###

N, H, W = map(int, input().split())
A = []
B = []
counter = 0
for i in range(0,N):
    a,b  = map(int, input().split())
    if a>=H and b>=W:
        counter +=1
print(counter)
hoge = input().split()
while i < range(len(hoge)):
  if i%2==0 and hoge[i] == 'L' or 'D' or 'U':
    pass
  elif i%2==1 and hoge[i] == 'R' or 'D' or 'U':
    pass
  else:
    break
  i+=1
if i == len(hoge):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import re
hoge = list(input())
i = 0
while i < len(hoge):
    if i%2==0 and re.findall(r'[RDU]',hoge[i]):
        pass
    elif i%2==1 and re.findall(r'[LDU]',hoge[i]):
        pass
    else:
        break
    i+=1
if i == len(hoge):
  print('Yes')
else:
  print('No')
N = int(input())
N = str(N)

a = int(N[-3])
b = int(N[-2])
c = int(N[-1])
x = 100*a + 10*b + c
ans = 1000 - x
if ans == 1000:
    ans = 0
print(ans)

### FIXED CODE ###

N = int(input())
N = str(N)

if len(N) == 2:
    b = int(N[-2])
    c = int(N[-1])
    x = 10*b + c
elif len(N) == 1:
    c = int(N[-1])
    x = c
else:
    a = int(N[-3])
    b = int(N[-2])
    c = int(N[-1])
    x = 100*a + 10*b + c
ans = 1000 - x
if ans == 1000:
    ans = 0
print(ans)
N,M= map(int,input().split())

tempP = ""
ac = []
wa = []

for count in range(M):
    ac.append(0)
    wa.append(0)

for count in range(M):
    P,S = input().split()
    P = int(P)
    P -= 1
    
    if ac[P] == 0:
        if S == "AC":
            ac[P] = 1
        else:
            wa[P] +=1


print(str(sum(ac)) + " " + str(sum(wa)))

    

### FIXED CODE ###

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

tempP = ""
ac = []
wa = []

for count in range(N):
    ac.append(0)
    wa.append(0)

for count in range(M):
    P,S = input().split()
    P = int(P)
    P -= 1
    
    if ac[P] == 0:
        if S == "AC":
            ac[P] = 1
        else:
            wa[P] +=1



a = 0
b = 0
 
for i in range(N):
    if ac[i] == 1:
        a += 1
        b += wa[i]
 
print(*[a, b])
n = int(input())
a = list(map(int, input().split()))
if (a.include(0)):
  print(0)
  exit()
MAX = 10 ** 18
ans = 1
for i in range(len(a)):
  ans *= a[i]
  if (ans > MAX):
    print(-1)
    exit()
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
if (0 in a):
  print(0)
  exit()
MAX = 10 ** 18
ans = 1
for i in range(len(a)):
  ans *= a[i]
  if (ans > MAX):
    print(-1)
    exit()
print(ans)
from operator import itemgetter
N, H = map(int, input().split())
ab = []
for i in range(N):
    n, m = map(int, input().split())
    ab.append([n, m])

max_count = 0
ab = sorted(ab, key = lambda x:(-x[1], x[0]))
a_max = max(a)
for i in range(N):
    if a[i] == a_max:
        max_count += 1
print(ab)
ans = 0
for i in range(N):
    if H <= 0:
        break
    if H <= ab[0][1] or H <= a_max:
        ans += 1
        break
    if a_max < ab[0][1]:
        if ab[0][0] == a_max:
            if max_count > 1:
                max_count -= 1
                H -= ab.pop(0)[1]
                ans += 1
            else:
                H -= ab[0][1]
                ans += 1
                if H <= 0:
                    break
                else:
                    ans += 1 + (H-1) // ab[0][0]
                    break
        else:
            H -= ab.pop(0)[1]
            ans += 1
    else:
        ans += 1 + (H-1) // a_max
print(ans)


### FIXED CODE ###

from operator import itemgetter
N, H = map(int, input().split())
b = []
a = []
for i in range(N):
    n, m = map(int, input().split())
    b.append(m)
    a.append(n)
a_max = max(a)
ans = 0
b.sort(reverse = True)
for i in range(N):
    if H <= b[i] or H <= a_max:
        ans += 1
        break
    if b[i] >= a_max:
        H -= b[i]
        ans += 1
        if i == N-1:
            ans += 1 + ((H-1) // a_max)

    else:
        ans += 1 + ((H-1) // a_max)
        break
print(ans)
import math

def overlap(p1, p2, d):
    return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 <= d

def intersection(o1,o2):
    a  = 2*(o2[0] - o1[0])
    b  = 2*(o2[1] - o1[1])
    c  = (o1[0] - o2[0])*(o1[0] + o2[0]) + (o1[1] - o2[1])*(o1[1] + o2[1])
    a2 = a**2 + b**2
    b2 = a*c + a*b*o1[1] - b**2*o1[0]
    c2 = b**2*(o1[0]**2 + o1[1]**2 - 1) + c**2 + 2*b*c*o1[1]
    x1 = (-b2 + math.sqrt(b2**2 - a2*c2))/a2
    x2 = (-b2 - math.sqrt(b2**2 - a2*c2))/a2
    if abs(b) < 10e-6:
        y1 = (o1[1] + o2[1])/2
        y2 = (o1[1] + o2[1])/2
    else:
        y1 = -(a*x1 + c)/b
        y2 = -(a*x2 + c)/b
    if abs(b2**2 - a2*c2) < 10e-6:
        return [x1, y1], [None, None]
    else:
        return [x1, y1], [x2, y2]

while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            if not overlap(p[i], p[j], 4):
                continue
            elif overlap(p[i], p[j], 10e-6):
                continue
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if overlap(p1, p[k], 1):
                    cnt1 += 1
                if p2[0] != None and overlap(p2, p[k], 1):
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)



### FIXED CODE ###

import math

def dist(p1, p2):
    return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)

def intersection(o1,o2):
    if dist(o1,o2) > 2:
        p1, p2 =  [None, None], [None, None]
    elif dist(o1,o2) == 2:
        p1, p2 =  [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2], [None, None]
    else:
        m = [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2]
        v = [m[0] - o1[0], m[1] - o1[1]]
        v_abs = dist(v,[0,0])
        w = [v[1], -v[0]]
        w_abs = dist(w,[0,0])
        n = [w[0]/w_abs, w[1]/w_abs]
        l = math.sqrt(1 - v_abs**2)
        p1 = [m[0] + l*n[0], m[1] + l*n[1]]
        p2 = [m[0] - l*n[0], m[1] - l*n[1]]
    return p1, p2
err = 1.0e-6
while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 1
    for i in range(n - 1):
        for j in range(i + 1, n):
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if p1[0] and dist(p1, p[k]) <= 1 + err:
                    cnt1 += 1
                if p2[0] and dist(p2, p[k]) <= 1 + err:
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)
N,M = map(int,input().split())
l = [[0 for _ in range(M)] for _ in range(M)]
for _ in range(M):
    a,b = map(int,input().split())
    l[a-1][b-1] = 1
    l[b-1][a-1] = 1
g = 0
def dfs(a,route):
    global g
    if len(route) == N:g += 1
    else:
        for i in range(N):
            if a == i:pass
            else:
                if l[a][i] == 1 and (not i in route):dfs(i,route+[i])
dfs(0,[0])
print(g)

### FIXED CODE ###

N,M = map(int,input().split())
if M == 0:
    print(0)
else:
    l = [[0 for _ in range(N)] for _ in range(N)]
    for _ in range(M):
        a,b = map(int,input().split())
        l[a-1][b-1] = 1
        l[b-1][a-1] = 1
    g = 0
    def dfs(a,route):
        global g
        if len(route) == N:g += 1
        else:
            for i in range(N):
                if a == i:pass
                else:
                    if l[a][i] == 1 and (not i in route):
                        dfs(i,route+[i])
    dfs(0,[0])
print(g)