Harryxun/stf_run huggingface dataset:
N = int(input())
a = list(map(int, input().split()))

a.sort()
xy = [[] for i in range(N-1)]
cnt = 0
while len(a) > 2:
    if a[len(a)-1] > 0 and a[len(a)-2] > 0:
        n = a[0] - a[len(a)-1]
        xy[cnt] = [a[0], a[len(a)-1]]
        a = [n]
        a.extend(a[1:len(a) - 1])
    else:
        n = a[len(a)-1] - a[0]
        xy[cnt] = [a[len(a)-1], a[0]]
        a = a[1:len(a) - 1]
        a.extend([n])
    cnt += 1

m = a[1] - a[0]
xy[cnt] = [a[1], a[0]]
print(m)
for _xy in xy:
    print(str(_xy[0]) + " " + str(_xy[1]))



### FIXED CODE ###

from collections import deque

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

a.sort()

if a[0] >= 0:
    m = sum(a[1:]) - a[0]
    print(m)
    p = a.pop(0)
    while len(a) > 1:
        b = a.pop(0)
        print(*[p, b])
        p -= b
    b = a.pop()
    print(*[b, p])
elif a[-1] <= 0:
    m = -sum(a[:-1])+a[-1]
    print(m)
    p = a.pop(-1)
    while len(a) > 0:
        b = a.pop(0)
        print(*[p, b])
        p -= b
else:
    mi = list(filter(lambda x: x < 0, a))
    pl = list(filter(lambda x: x >= 0, a))
    m = -sum(mi) + sum(pl)
    print(m)
    lp = pl.pop(0)
    mi = deque(mi)
    while len(pl) > 0:
        b = pl.pop()
        c = mi.pop()
        print(*[c, b])
        c -= b
        mi.append(c)
    while len(mi) > 0:
        b = mi.pop()
        print(*[lp, b])
        lp -= b
#68a
n=input()
pritn('ABC'+n)

### FIXED CODE ###

#68a
n=input()
print('ABC'+ n )
h,w=map(int,input().split())
mapdata=[]
result=[]
k=[]
def get_bomb(i,j):
  count=0
  for x in (i-1.i,i+1):
    for y in (j-1,j,j+1):
      if 0<=x<=h-1 and 0<=y<=w-1:
        if mapdata[x][y]=='#':
          count+=1
  return count
for i in range(h):
  line=list(input())
  mapdata.append(line)
for i in range(h):
  for j in range(w):
    if mapdata[i][j]=='.':
      k.append(get_bomb(i,j))
    else:
      k.append('#')
  result.append(k)
  k=[]
for i in range(len(result)):
  print(result[i])

### FIXED CODE ###

h,w=map(int,input().split())
mapdata=[]
for i in range(h):
  line=(str(input()))
  line2=list(line)
  mapdata.append(line2)
result=[]
k=[]
def get_bomb(i,j):
  count=0
  for x in (i-1,i,i+1):
    for y in (j-1,j,j+1):
      if 0<=x<=h-1 and 0<=y<=w-1:
        if mapdata[x][y]=='#':
          count+=1
  return count
for i in range(h):
  for j in range(w):
    if mapdata[i][j]=='.':
      k.append(str(get_bomb(i,j)))
    else:
      k.append('#')
  result.append(k)
  k=[]
for i in range(len(result)):
  result2=''.join(result[i])
  print(result2)
n,m=map(int,input().split())
a=list(map(int,input().split()))
d=[]
for i in range(m):
    bi,ci=map(int,input().split())
    for ii in range(bi):
        d.append(ci)
        
a.sort()
d.sort(reverse=True)

for i in range(n):
    if a[i]<d[i]:
        a[i]=d[i]
    else:
        break
    
print(sum(a))


### FIXED CODE ###

import sys
from bisect import bisect_left,bisect,bisect_right

icase=0
if icase==0:
    n,m=map(int,input().split())
    a=list(map(int,input().split()))
    d=[]
    cb=[[0]*2 for i in range(m)]
    for i in range(m):
        bi,ci=map(int,input().split())
        cb[i]=[ci,bi]
elif icase==1:
    n,m=3,2
    a=[1, 4, 5]
    cb=[[5, 1], [3, 2]]
elif icase==3:
    n,m=3,2
    a=[100, 100, 100]
    cb=[[99, 3], [99, 3]]
elif icase==2:
    n,m=10,3
    a=[1, 4, 5, 5, 7, 8, 13, 33, 52, 100]
    cb=[[30, 4], [10, 3], [4, 1]]
elif icase==4:
    n,m=11,3
    a=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
    cb=[[1000000000, 4], [1000000000, 3], [1000000000, 3]]
elif icase==5:
    f=open(r"C:\Users\nishi\999atcoder\ABCD040-151\ABC127D\testcase_13_in.dat")
    ll=f.readline()
    n,m=map(int,ll.split())
    ll=f.readline()
    a=list(map(int,ll.split()))
    d=[]
    cb=[[0]*2 for i in range(m)]
    for i in range(m):
        ll=f.readline()
        bi,ci=map(int,ll.split())
        cb[i]=[ci,bi]
    f.close()
    ans=99913215738299
elif icase==6:
    f=open(r"C:\Users\nishi\999atcoder\ABCD040-151\ABC127D\testcase_12_in.dat")
    ll=f.readline()
    n,m=map(int,ll.split())
    ll=f.readline()
    a=list(map(int,ll.split()))
    d=[]
    cb=[[0]*2 for i in range(m)]
    for i in range(m):
        ll=f.readline()
        bi,ci=map(int,ll.split())
        cb[i]=[ci,bi]
    f.close()
    ans=95821339675952

a.sort()
cb.sort(reverse=True)

if cb[0][0]<=a[0]:
    print(sum(a))
    sys.exit()
    
asum=0
isum=0
isumm=0
for i in range(m):
    isum+=cb[i][1]
    if isum>n:
        if a[-1]<=cb[i][0]:
#        print("A",i)
            asum+=cb[i][0]*(n-isumm)
            print(asum)
            sys.exit()
#    isum=min(isum,n)
#    print(i,isum,a[isum-1])
        else:
#        print("C",i)
            ii=bisect_right(a,cb[i][0])
            asum+=cb[i][0]*(ii-isumm)
#        print(ii,isumm,asum)
#        asum+=sum(a[ii:isum])
            asum+=sum(a[ii:])
            print(asum)
            sys.exit()
    if a[isum-1]<=cb[i][0]:
        asum+=cb[i][0]*cb[i][1]
#        asum+=cb[i][0]*(isum-isumm)
#        print("B",i,isum,asum)
        isumm=isum
        continue
    else:
#        print("C",i)
        ii=bisect_right(a,cb[i][0])
        asum+=cb[i][0]*(ii-isumm)
#        print(ii,isumm,asum)
#        asum+=sum(a[ii:isum])
        asum+=sum(a[ii:])
        print(asum)
        sys.exit()
#        isumm=isum
#        break
    isumm=isum
    
#if isumm<n:
asum+=sum(a[isumm:])
        
print(asum)
a,b,c = map(int,input().split())
if sum(a,b,c) % 2 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a + b == c or a + c == b or b + c == a:
    print("Yes")
else:
    print("No")
a = [x for x in range(9)]
for i in a:
    for j in a:
        print('{}x{}={}'.format(i + 1, j + 1, (i + 1) * (j + 1))

### FIXED CODE ###

a = range(1, 10)
[print('{}x{}={}'.format(i, j, i * j)) for i in a for j in a]
import sys

N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[1] = 1
dp[2] = 2

if 1 in skip:
    dp[1] = 0
    dp[2] = 1
if 2 in skip:
    dp[2] = 0
if N in skip:
    print(0)
    sys.exit()

for i in range(3, N+1):
    if i in skip:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])


### FIXED CODE ###

N, M = map(int, input().split())
dp = [0 for _ in range(N+1)]
skip = {}

for _ in range(M):
    skip[int(input())] = 1

dp[0] = 1
if 1 not in skip:
    dp[1] = 1

for i in range(2, N+1):
    if i in skip:
        continue
    dp[i] += (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])
# 数のbitに含まれる1の数をカウント
def bitsoncount(x):
    return bin(x).count('1')

def solve(x):
    global ans
    bx = bitsoncount(x)
    if bx == 0:
        return ans
    else:
        ans += 1
        x = x % bx
        solve(x)


N = int(input())
X = input()

Xb = bitsoncount(int(X, 2))
X0 = int(X, 2) % (Xb-1)
X1 = int(X, 2) % (Xb+1)

for x, i in zip(X, reversed(range(N))):
    x = int(x)
    if x == 0:
        temp = (X1 + pow(2, i, Xb+1))
        ans = 1
    else:
        if Xb - 1 == 0:
            print(0)
            continue
        temp = (X0 - pow(2, i, Xb-1))
        ans = 1
    
    solve(temp)
    print(ans)

### FIXED CODE ###

# 数のbitに含まれる1の数をカウント
def bitsoncount(x):
    return bin(x).count('1')

def solve(x):
    global ans
    bx = bitsoncount(x)
    if bx == 0:
        return ans
    else:
        ans += 1
        x = x % bx
        solve(x)


N = int(input())
X = input()

Xb = bitsoncount(int(X, 2))
if (Xb - 1) != 0:
    X0 = int(X, 2) % (Xb-1)
X1 = int(X, 2) % (Xb+1)

for x, i in zip(X, reversed(range(N))):
    x = int(x)
    if x == 0:
        temp = (X1 + pow(2, i, Xb+1)) % (Xb+1)
        ans = 1
    else:
        if Xb - 1 == 0:
            print(0)
            continue
        temp = (X0 - pow(2, i, Xb-1)) % (Xb-1)
        ans = 1
    
    solve(temp)
    print(ans)
al = list(map(int, raw_input().split(" "))).sort()
print(al[0],al[1],al[2])

### FIXED CODE ###

al = list(map(int, input().split()))
al = sorted(al)
print(al[0],al[1],al[2])
n,w_max=map(int,input().split())
W,V=[],[]
for i in range(n):
  w,v=map(int,input().split())
  W.append(w)
  V.append(v)
w_tot=sum(W)
DP=[[-float("inf") for i in range(w_tot+1)] for j in range(n)]
for i in range(n):
  DP[i][0]=0
DP[0][W[0]]=V[0]
for i in range(1,n):
  for j in range(w_tot+1):
    if j>=W[i]:
      DP[i][j]=max(DP[i-1][j],DP[i-1][j-W[i]]+V[i])
    else:
      DP[i][j]=DP[i-1][j]
print(max(DP[n-1][i] for i in range(w_max+1)))

### FIXED CODE ###

n,w_max=map(int,input().split())
W,V=[],[]
for i in range(n):
  w,v=map(int,input().split())
  W.append(w)
  V.append(v)
DP=[[0 for i in range(w_max+1)] for j in range(n)]
for i in range(w_max+1):
  if i>=W[0]:
    DP[0][i]=V[0]
for i in range(1,n):
  for j in range(w_max+1):
    if j>W[i]:
      DP[i][j]=max(DP[i-1][j],DP[i-1][j-W[i]]+V[i])
    elif j==W[i]:
      DP[i][j]=max(DP[i-1][j],V[i])
    else:
      DP[i][j]=DP[i-1][j]
print(DP[n-1][w_max])
A,B = map(int,input().split())
K = (A+B)/2
if == isinstance(K,float):
  print("IMPOSSIBLE")

### FIXED CODE ###

A,B = map(int,input().split())
if (A+B)%2 != 0:
  print("IMPOSSIBLE")
else:
  print((A+B)//2)
x1, y1, x2, y2 = map(int, input().split())

a = x2 - x1
b = y2 - y1

x3 = x2 - b
y3 = y2 + a
x4 = x1 - b
y4 = y1 + a

print("{} {} {} {}".format(x3, y3, x4, y4))

### FIXED CODE ###

K = int(input())
print((K - int(K / 2)) * int(K / 2))
K,X=int(input().split())
if K*500>=X:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

K,X=map(int,input().split())
if K*500>=X:
  print('Yes')
else:
  print('No')
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(int(input()))

case = [0] * (N + 1)
case[0] = 1
if not 1 in A:
    case[1] = 1

if A[0]==1:
    j=1
    flag=True
else:
    j=0
    flag=False
for x in range(2, N + 1):
    if x==A[j]:
        case[x] = 0
        j=(j+1)%M
        flag=True
    elif flag==True:
        case[x] = case[x - 2]
        flag=False
    else:
        case[x] = (case[x - 1] + case[x - 2]) % 1000000007
        flag=False

print(case[N])

### FIXED CODE ###

N, M = map(int, input().split())
A = [1] * (N + 1)
ans = [0] * (N + 1)
ans[0] = 1
for _ in range(M):
    A[int(input())] = 0
for i in range(1, N + 1):
    ans[i] = (ans[i - 2] * A[i - 2] + ans[i - 1] * A[i - 1]) % 1000000007

print(ans[N])
a=input()
for i in range(3):
  input()
e=input()
k=input()
if e-a<=k:
  print("Yay!")
else:
  print(":(")

### FIXED CODE ###

a=input()
for i in range(3):
  input()
e=input()
k=input()
if int(e)-int(a)<=int(k):
  print("Yay!")
else:
  print(":(")
S=list(input())
l=sorted(list(set(S)))
for i in range(97,97+26):
    if chr(i) !=l.pop(0):
        print(chr(i))
        break


### FIXED CODE ###

S=list(input())
l=sorted(list(set(S)))
for (i,j) in zip(range(len(l)),range(97,97+26)):
    if chr(j) !=l[i]:
        print(chr(j))
        exit()
    elif chr(j) == 'z':
        print('None')
        exit()
print(chr(j+1))
def main():
    W, H, x, y, r = [int(i) for i in input().split()]
    if x-r >= 0, x+r <= w , y-r >= 0, y+r <= H :
        print("Yes")
    else :
        print("No")
    if __name__ == '__main__' :
        main()

### FIXED CODE ###

def main() :
    W, H, x, y, r = [int(i) for i in input().split()]

    if ((x-r)>=0) and ((x+r)<=W) and ((y-r)>=0) and ((y+r)<=H) :
        print("Yes")
    else :
        print("No")

if __name__ == '__main__' :
    main()
import sys
from sys import stdin

N, k = [int(x) for x in stdin.readline().rstrip().split()]

if K < 2:
    raise Exception('Error!')

sum = K
for i in range(N-1):
    sum = sum*(K-1)

if __name__ == '__main__':
    print(sum)

"""
def myfunc(n, k):
    if n <= 0:
        return k
    n = int(n-1)
    k = k*(k-1)
    return myfunc( n,k )

if __name__ == '__main__':
    print(int(myfunc(N, K)))
"""


### FIXED CODE ###

import sys
from sys import stdin

N, K = [int(x) for x in stdin.readline().rstrip().split()]

if K < 2:
    raise Exception('Error!')

sum = K
for i in range(N-1):
    sum = sum*(K-1)

if __name__ == '__main__':
    print(sum)

"""
def myfunc(n, k):
    if n <= 0:
        return k
    n = int(n-1)
    k = k*(k-1)
    return myfunc( n,k )

if __name__ == '__main__':
    print(int(myfunc(N, K)))
"""
if(int(input()) 1000):
  print("ABC")
else:
  print("ABD")
  

### FIXED CODE ###

if(int(input()) < 1000):
  print("ABC")
else:
  print("ABD")
N = input()
for i in range(10):
  cnt += i * N.count(str(i))
print("Yes" if cnt % 9 == 0 else "No")

### FIXED CODE ###

N=int(input())
if N%9==0:
  print('Yes')
else:
  print('No')
n, q = map(int, input().split())
tree = {}
for i in range(n-1):
    a, b = map(int, input().split())
    tree[b] = a
ans = [0]*n
for i in range(q):
    a, b = map(int, input().split())
    ans[a-1] += b
for i in range(2, n+1):
    ans[i-1] += ans[tree[i]-1]
for i in ans:
    print(i, end=" ")

### FIXED CODE ###

from collections import deque

def main():
    n, q = map(int, input().split())
    tree = [[] for _ in range(n)]
    for i in range(n-1):
        a, b = map(int, input().split())
        tree[a-1].append(b-1)
        tree[b-1].append(a-1)
    
    ans = [0]*n
    for _ in range(q):
        p, x = map(int, input().split())
        ans[p-1] += x
    
    not_yet = deque([0])
    already = [False]*n
    already[0] = True
    
    while not_yet:
        key = not_yet.popleft()
        for value in tree[key]:
            if already[value]:
                continue
            already[value] = True
            not_yet.append(value)
            ans[value] += ans[key]
    
    print(*ans)

if __name__ == "__main__":
    main()
N = int(input())
S = input()
O = {'R':[], 'G':[], 'B':[]}
for i,c in enumerate(S):
    O[c].append(i)
ans = len(O['R'])*len(O['G'])*len(O['B'])
for i in O['R']:
    for j in O['G']:
        for k in O['B']:
            m = sorted([i,j,k])
            if m[2]-m[1] == m[1]-m[0]:
                ans -= 1
print(ans)


### FIXED CODE ###

N = list(input())
print('Yes' if '7' in N else 'No')
while 1:
	n = input()
	if n == 0: break
	a = map(int,raw_input().split())
	ref = [0]
	for i in a:
		ref += [i+j for j in ref if j < ans/2]
	print min(abs(sum(a)-2*i) for i in ref)

### FIXED CODE ###

def S(i,x,y):
	if 2*x >= A: return 2*x-A
	if 2*y >= A: return 2*y-A
	return min(S(i+1,x+a[i],y),S(i+1,x,y+a[i]))
while 1:
	n = input()
	if n == 0: break
	a = sorted(map(int,raw_input().split()))[::-1]
	A = sum(a)
	print S(1,a[0],0)
while True:
    # try:
    case=0
    while True:
        case+=1
        weight=input()
        if weight==0:
            break
        N=input()
        data=[[0 for i in range(2)] for j in range(N)]
        for i in range(N):
            data[i][0],data[i][1]=map(int,raw_input().split(","))
        table=[[-1 for i in range(weight+1)] for j in range(N)]
        for i in range(N):
            table[i][0]=0
        table[0][data[0][1]]=data[0][0]
        for i in range(0,N-1):
            for j in range(weight+1):
                if table[i][j]!=-1 and j+data[i+1][1] <= weight:
                    table[i+1][j+data[i+1][1]]=table[i][j]+data[i+1][0]
        sum=max(table[N-1])
        print "Case "+str(case)+":"
        print sum
        print table[N-1].index(sum)
#    except:
#break

### FIXED CODE ###

case=0
while True:
    try:
        case+=1
        W=input()
        if W==0:
            break
        N=input()
        data=[[0 for i in range(2)] for j in range(N)]
        for i in range(N):
            data[i][0],data[i][1]=map(int,raw_input().split(","))
        table=[[-1 for i in range(W+1)] for j in range(N)]
        table[0][0],table[0][data[0][1]]=0,data[0][0]
        for i in range(1,N):
            for j in range(W+1):
                table[i][j]=table[i-1][j]
            for j in range(W+1):
                if table[i-1][j]!=-1 and j+data[i][1]<=W and\
                   table[i-1][j]+data[i][0]>table[i][j+data[i][1]]:
                    table[i][j+data[i][1]]=table[i-1][j]+data[i][0]
        print "Case "+str(case)+':'
        m=max(table[N-1])
        print m
        print table[N-1].index(m)
    except:
        break
n,a,b=map(int,[input() for i in range(3)])
print('Hello World' if n==1 else a+b)

### FIXED CODE ###

n=int(input())
if n==1:
  print('Hello World')
else:
  a=int(input());b=int(input())
  print(a+b)
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

from fractions import Fraction

mod = 1e9+7
n = ii()
cnd = {}
azero = 0
bzero = 0
for _ in range(n):
    a,b = iim()
    if a*b == 0:
        if a == 0 and b != 0:
            azero += 1
        elif a != 0 and b == 0:
            bzero += 1
    else:
        ratio = Fraction(a,b)
        before = cnd.get(ratio,False)
        check = cnd.get(-1*Fraction(1,ratio),False)
        if before:
            cnd[ratio] = [before[0]+1,before[1]]
        elif check:
            cnd[-1*Fraction(1,ratio)] = [check[0],check[1]+1]
        else:
            cnd[ratio] = [1,0]

cnd[0] = [azero,bzero]
noreg = 0
ans = 1
#print(cnd)
for item in cnd.values():
    if item[0] == 0  or item[1] == 0:
        noreg += max(item[0],item[1])
    else:
        ans *= (2**item[0]+2**item[1]-1)
        ans %= mod
#print(ans,noreg)
print(int((ans*((2**noreg)%mod)-1)%mod))

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

#from fractions import Fraction
from math import gcd

mod = int(1e9+7)
n = ii()
cnd = {}
azero = 0
bzero = 0
allzero = 0
for _ in range(n):
    a,b = iim()
    if a == 0:
        if b != 0:
            azero += 1
        else:
            allzero += 1
    elif b == 0:
        bzero += 1            
    else:
        '''
        ratio = Fraction(a,b)
        before = cnd.get(ratio,False)
        if before:
            cnd[ratio] = [before[0]+1,before[1]]
        else:
            invratio = Fraction(-b,a)
            check = cnd.get(invratio,False)
            if check:
                cnd[invratio] = [check[0],check[1]+1]
            else:
                cnd[ratio] = [1,0]
        '''
        g = gcd(a,b)
        a //= g
        b //= g
        if a < 0:
            a *= -1
            b *= -1
        cnd[(a,b)] = cnd.get((a,b),0)+1


noreg = 0
if azero == 0 or bzero == 0:
    noreg += max(azero,bzero)
    ans = 1
else:
    ans = (2**azero%mod + 2**bzero%mod - 1)%mod
#print('ans block')
#print(ans,noreg)
#print(cnd)
for k,item in cnd.items():
    a,b = k
    if b>0:
        m = cnd.get((b,-a),False)
        if m:
            ans *= (2**item%mod+2**m%mod-1)%mod
        else:
            noreg += item
    else:
        m = cnd.get((-b,a),False)
        if not m:
            noreg += item
#print('hoge')
print(int((ans*((2**noreg)%mod)-1+allzero)%mod))
from __future__ import division
import math

def cross(p1,p2):
    a,b,c,d=p1[0],p1[1],p2[0],p2[1]
    t=pow(a,2)+pow(c,2)+pow(d,2)-pow(b,2)-2*a*c
    alpha=4*(pow(b-d,2)+pow(c-a,2))
    beta=4*(t*(b-d)-2*b*pow(c-a,2))
    gamma=pow(t,2)+4*pow(b,2)*pow(c-a,2)-4*pow(c-a,2)
    judge=pow(beta,2)-4*alpha*gamma
    if judge>0:
        y1=(-beta+math.sqrt(judge))/(2*alpha)
        y2=(-beta-math.sqrt(judge))/(2*alpha)
        x1=(2*(b-d)*y1+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        x2=(2*(b-d)*y2+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        return ((x1,y1),(x2,y2))
    elif judge==0:
        y=-beta/(2*alpha)
        x=(2*(b-d)*y+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        return ((x,y),)
    else:
        return None

def maxNum(P,L):
    ans=1
    for x,y in P:
        cnt=0
        for px,py in L:
            d=math.sqrt(pow(px-x,2)+pow(py-y,2))
            if d<=1:
                cnt+=1
        ans=max(ans,cnt)
    return ans

while True:
    n=input()
    if n==0:break
    L=[map(float,raw_input().split(",")) for i in range(n)]
    P=[]
    for i in range(n-1):
        for j in range(i+1,n):
            points=cross(L[i],L[j])
            if points:
                P.extend(points)
    print maxNum(P,L)

### FIXED CODE ###

from __future__ import division
import math

def cross(p1,p2):
    a,b,c,d=p1[0],p1[1],p2[0],p2[1]
    t=pow(a,2)+pow(c,2)+pow(d,2)-pow(b,2)-2*a*c
    alpha=4*(pow(b-d,2)+pow(c-a,2))
    beta=4*(t*(b-d)-2*b*pow(c-a,2))
    gamma=pow(t,2)+4*pow(b,2)*pow(c-a,2)-4*pow(c-a,2)
    judge=pow(beta,2)-4*alpha*gamma
    EPS=1e-5
    if c==a:
        y=(pow(a,2)+pow(b,2)-pow(c,2)-pow(d,2))/(2*(b-d))
        bd=pow(b-d,2)
        a1=4*bd
        b1=-8*a*bd
        c1=4*a*a*bd+pow(a*a-b*b-c*c-d*d+2*b*d,2)-4*bd
        inroot=pow(b1,2)-4*a1*c1
        if inroot<0:
            return None
        x1=(-b1+math.sqrt(inroot))/(2*a1)
        x2=(-b1-math.sqrt(inroot))/(2*a1)
        return ((x1,y),(x2,y))

    if judge>EPS:
        y1=(-beta+math.sqrt(judge))/(2*alpha)
        y2=(-beta-math.sqrt(judge))/(2*alpha)
        x1=(2*(b-d)*y1+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        x2=(2*(b-d)*y2+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        return ((x1,y1),(x2,y2))
    elif -EPS<=judge<=EPS:
        y=-beta/(2*alpha)
        x=(2*(b-d)*y+pow(c,2)+pow(d,2)-pow(a,2)-pow(b,2))/(2*(c-a))
        return ((x,y),)
    else:
        return None

def maxNum(P,L):
    ans=1
    for x,y in P:
        cnt=0
        for px,py in L:
            d=math.sqrt(pow(px-x,2)+pow(py-y,2))
            if d<=1:
                cnt+=1
        ans=max(ans,cnt)
    return ans

while True:
    n=input()
    if n==0:break
    L=[map(float,raw_input().split(",")) for i in range(n)]
    P=[]
    for i in range(n-1):
        for j in range(i+1,n):
            points=cross(L[i],L[j])
            if points:
                P.extend(points)
    print maxNum(P,L)
s = input().split()
a = int(s[0])
b = int(s[1]replace(, '.', ''))
ans = floor(a*b/100)
print(ans)

### FIXED CODE ###

a, b = input().split()
a = int(a)
b = list(map(int, b.split('.')))
b = b[0]*100+b[1]
ans = a*b
if ans<100:
  print(0)
else:
  print(str(ans)[:-2])
x,n=map(int, input().split())
ans=x
judge=True
if(n!=0):
  p=list(map(int, input().split()))
else:
  ans=x
  judge=False

if(judge):
  check=True
  s_list=[]
  l_list=[]
  for i in range(n):
    for j in range(n):
      if(x-i==p[j]):
        check=False
    if(check):
      s_list.append(x-i)
    check=True

  for i in range(n):
    for j in range(n):
      if(x+i==p[j]):
        check=False
    if(check):
      l_list.append(x+i)
    check=True
  if(abs(x-min(l_list)) > abs(x-max(s_list))):
    ans = max(s_list)
  elif(abs(x-min(l_list))==abs(x-max(s_list))):
    ans=max(s_list)
  else:
    ans=min(l_list)
  
print(ans)

### FIXED CODE ###

x,n=map(int, input().split())
ans=x
judge=True
if(n!=0):
  p=list(map(int, input().split()))
else:
  ans=x
  judge=False
  
if(n==1):
  if(x==p[0]):
    ans = x-1
    judge=False

if(judge):
  check=True
  s_list=[]
  l_list=[]
  for i in range(n):
    for j in range(n):
      if(x-i==p[j]):
        check=False
    if(check):
      s_list.append(x-i)
    check=True

    for i in range(n):
      for j in range(n):
        if(x+i==p[j]):
          check=False
      if(check):
        l_list.append(x+i)
      check=True
    if(l_list == []):
      ans = max(s_list)
    if(s_list == []):
      ans = min(l_list)
    else:
      if(abs(x-min(l_list)) > abs(x-max(s_list))):
        ans = max(s_list)
      elif(abs(x-min(l_list))==abs(x-max(s_list))):
        ans=max(s_list)
      else:
        ans=min(l_list)  

print(ans)
A, B, AB, X, Y = map(int,input().split())
min_sheet = min(X,Y)

if A + B >= AB * 2:
    min_price = min(AB * 2 * min_sheet + A(X - min_sheet) + B(Y - min_sheet), AB * 2 * max(X,Y))
else:
    min_price = A * X + B * Y
    
print(min_price)

### FIXED CODE ###

A, B, AB, X, Y = map(int,input().split())
min_sheet = min(X,Y)

if A + B >= AB * 2:
    min_price = min(AB * 2 * min_sheet + A * (X - min_sheet) + B * (Y - min_sheet), AB * 2 * max(X,Y))
else:
    min_price = A * X + B * Y
    
print(min_price)