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

n,x,y = map(int,input().split())
x -= 1
y -= 1
dis = [0 for i in range(n)]
for i in range(n):
    for j in range(i+1,n):
        dis[min(abs(j-i),min(abs(j-y)+abs(x-i)+1,abs(j-x)+abs(y-i)+1))] += 1
print("\n".join(map(str,dis[1:])))

### FIXED CODE ###

n,x,y = map(int,input().split())
x -= 1
y -= 1
dis = [0 for i in range(n)]
for i in range(n):
    for j in range(i+1,n):
        dis[min(abs(j-i),min(abs(j-y)+abs(x-i)+1,abs(j-x)+abs(y-i)+1))] += 1
print("\n".join(map(str,dis[1:])))
### BUGGY CODE ###

n = int(input())
tmp = []
for i in range(n):
    s = list(str(input()))
    s.sort()
    tmpstr = "".join(s)
    tmp.append(tmpstr)
T = set(tmp)
ans = 0
for i in T:
    ans += (tmp.count(i) - 1 )*(tmp.count(i))//2
print(ans)

### FIXED CODE ###

import collections
n = int(input())
tmp = []
for i in range(n):
    s = list(str(input()))
    s.sort()
    tmpstr = "".join(s)
    tmp.append(tmpstr)
ans = 0
c = collections.Counter(tmp)
for i in c.keys():
    if c[i] >= 2:
        ans += (c[i]  - 1 )*(c[i] )//2
print(ans)
### BUGGY CODE ###

H, W, D = map(int, input().split())
positions = [[] for _ in range(H*W)]

for y in range(H):
    position = list(map(int, input().split()))
    for x in range(W):
        positions[position[x]-1] = [x, y]

def get_distance(a, b):
    return abs(positions[a][0] - positions[b][0]) + abs(positions[a][1] - positions[b][1])

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    L -= 1
    ans = 0
    for val in range(L+D, R+D-1, D):
        ans += get_distance(L, val)
        L = val
    print(ans)


### FIXED CODE ###

H, W, D = map(int, input().split())
positions = [[] for _ in range(H*W)]

for y in range(H):
    position = list(map(int, input().split()))
    for x in range(W):
        positions[position[x]-1] = [x, y]

def get_distance(a, b):
    return abs(positions[a][0] - positions[b][0]) + abs(positions[a][1] - positions[b][1])

answers = [[] for _ in range(D)]
d_length = (H * W) // D + 1
for d in range(D):
    current = d
    d_answers = [0 for _ in range(d_length)]
    idx = 1
    while current + D < H * W:
        d_answers[idx] = get_distance(current, current+D) + d_answers[idx-1]
        current += D
        idx += 1
    answers[d] = d_answers

Q = int(input())
for _ in range(Q):
    L, R = map(int, input().split())
    L -= 1
    R -= 1
    extra = L % D
    start = L // D
    end = R // D
    print(answers[extra][end]-answers[extra][start])
### BUGGY CODE ###

from collections import deque

n = int(input())

q = deque()

for _ in range(n):
	com,*num = input().split(" ")

	if com == "insert":
		q.appendleft(int(num[0]))
	elif com == "delete":
		if q.count(int(num[0])) != 0:
			q.remove(int(num[0]))
	elif com == "deleteFirst":
		q.popleft()
	elif com == "deleteLast":
		q.pop()

print(*q)




### FIXED CODE ###

from collections import deque
from sys import stdin

n = int(input())

q = deque()

for _ in range(n):
	cmd = stdin.readline().strip().split()
	if cmd[0] == "insert":
		q.appendleft(cmd[1])
	elif cmd[0] == "deleteFirst":
		q.popleft()
	elif cmd[0] == "deleteLast":
		q.pop()
	elif cmd[0] == "delete":
		try:
			q.remove(cmd[1])
		except:
			pass

print(*q)
### BUGGY CODE ###

import math

n, d, a = map(int,input().split())
xh = [[0 for i in range(2)] for j in range(n)]
rang = [0]*n
for i in range(n):
    x,h = map(int,input().split())
    xh[i] = [x,h]

num = 0
xh.sort(key=lambda xh:xh[0])

for i in range(n):
    for j in range(i+1,n):
        if xh[i][0]+d < xh[j][0]-d:
            rang[i] = j
            break
        elif j == n-1:
            rang[i] = n

dam = [0]*n
for i in range(n):
    res = xh[i][1]-dam[i]
    pos = xh[i][0]
    if res > 0:
        nat = math.ceil(res/a)
        num += nat
        for j in range(i+1,rang[i]):
            dam[j] += a*nat

print(num)


### FIXED CODE ###

import math

n, d, a = map(int,input().split())
xh = [[0 for i in range(2)] for j in range(n)]
left = [i for i in range(n)]
for i in range(n):
    x,h = map(int,input().split())
    xh[i] = [x,h]

num = 0
xh.sort(key=lambda xh:xh[0])

for i in range(n):
    for j in range(left[i-1],i):
        if xh[j][0]+d >= xh[i][0]-d:
            left[i] = j
            break

dam = [0]*n

def dsum(k):
    if k == 0:
        return 0
    elif left[k] == 0:
        return dam[k-1]
    else:
        return dam[k-1]-dam[left[k]-1]

for i in range(n):
    res = xh[i][1]-dsum(i)
    nat = max([math.ceil(res/a),0])
    dam[i] = dam[i-1]+a*nat
    if res > 0:
        num += nat

print(num)
### BUGGY CODE ###

import copy
n, k = map(int, input().split())
a = list(map(lambda x:int(x)%k, input().split()))
a2 = copy.deepcopy(a)
b = 0
c = 0
for i in range(1,min(n,k-1)+1):
  b += sum([1 for j in a2[:(n-i+1)] if j==i])
  if i < min(n,k-1):
    a2 = [(a[i+j]+a2[j])%k for j in range(n-i)]
print(b)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
a[0] = (a[0]-1)%k
for i in range(1,n):
  a[i] = (a[i]+a[i-1]-1)%k
ans = 0
b = {0:1}
for i in range(n):
  if i>0:
    b[a[i-1]] = b.get(a[i-1],0) + 1
  if i>=k:
    b[a[i-k]] -= 1
  if i==k-1:
    b[0] -= 1
  ans += b.get(a[i],0)
print(ans)
### BUGGY CODE ###

n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()
m = 10**10
for i in range(n-k+1):
    a = max(h[i:i+k])
    b = min(h[i:i+k])
    if a - b < m:
        m = a - b

print(m)

### FIXED CODE ###

n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()
m = 10**10
for i in range(n-k+1):
    b = h[i]
    a = h[i+k-1]
    if a - b < m:
        m = a - b

print(m)
### BUGGY CODE ###

import sys
def shellsort(a):
    l = len(a)
    intervals = [n for n in (40, 13, 4, 1) if n <= l]
    count = 0
    for interval in intervals:
        for i in range(interval, l):
            v = a[i]
            j = i-interval
            while j >= 0 and v < a[j]:
                a[j+interval] = a[j]
                j -= interval
                count += 1
            a[j+interval] = v

    print(len(intervals))
    print(" ".join([str(n) for n in intervals]))
    print(count)
    print("\n".join([str(n) for n in a]))

input()
shellsort(list(map(int, sys.stdin.readlines())))

### FIXED CODE ###

def shellsort(a):
    l = len(a)
    gaps = [1]
    while gaps[0]*3+1 < (l/9 if l>100 else l) and len(gaps) <= 100:
        gaps.insert(0, gaps[0]*3+1)
    count = 0
    for g in gaps:
        for i in range(g, l):
            v = a[i]
            j = i-g
            while j >= 0 and v < a[j]:
                a[j+g] = a[j]
                j -= g
                count += 1
            a[j+g] = v

    print(len(gaps))
    print(" ".join([str(n) for n in gaps]))
    print(count)
    print("\n".join([str(n) for n in a]))

shellsort([int(input()) for _ in [None]*(int(input()))])
### BUGGY CODE ###

#D
S = list(str(input()))
N = len(S)
S = S[::-1]

DP = [-1]*(N+1)
DP[0] = 0
now = 0
for i in range(N):
    now+=int(S[i])*(10**i)
    now%=2019
    DP[i+1] = now
    
#print(DP)
tyo = [0]*2019
for dp in DP:
    tyo[dp]+=1

ans = 0
for t in tyo:
    ans+=(t*(t-1))//2
    
print(ans)




### FIXED CODE ###

#D
S = list(str(input()))
N = len(S)

U = []
for i in range(N):
    U.append(int(S[N-i-1]))


DP = [-1]*(N+1)
DP[0] = 0
now = 0
pnow = 1
for i,u in enumerate(U):
    pnow*=10
    pnow%=2019
    now+=int(u)*pnow
    now%=2019
    DP[i+1] = now
    
#print(DP)
tyo = [0]*2019
for dp in DP:
    tyo[dp]+=1

ans = 0
for t in tyo:
    ans+=(t*(t-1))//2
    
print(ans)
### BUGGY CODE ###

n,k=[int(x) for x in input().split()]
infy=float('inf')
arr=[int(x) for x in input().split()]

val=[infy]*(n)
val[0]=0
for i in range(0,n-1):
    for j in range(1,k+1):
        if i+j < n:
            val[i+j]=min(val[i+j],abs(arr[i+j]-arr[i])+val[i])


print(val[n-1])




### FIXED CODE ###

n,k=[int(x) for x in input().split()]
infy=float('inf')
arr=[int(x) for x in input().split()]

val=[infy]*(n)
val[0]=0
for i in range(0,n-1):
    for j in range(1,k+1):
        if i+j < n:
            val[i+j]=min(val[i+j],abs(arr[i+j]-arr[i])+val[i])


print(val[n-1])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**7)

from functools import lru_cache
S = input()
N = len(S)

@lru_cache
def solve(i, prev, K):
    if i >= N:
        return K
    ret = 0
    if S[i] != prev:
        ret = max(ret, solve(i+1, S[i], K+1))
    if S[i:i+2] != prev:
        ret = max(ret, solve(i+2, S[i:i+2], K+1))
    return ret


print(solve(0, '', 0))


### FIXED CODE ###

S = input()

ans = 0
prev = ''
curr = ''
for s in S:
    curr += s
    if prev != curr:
        ans += 1
        prev = curr
        curr = ''
print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(4100000)
import math
import fractions
import bisect

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行あり
x = []
y = []
for i in range(5):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

'''


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

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

    if M < i*N:
        break

    if (M - i*N) % i == 0:
        ans = i



print(int(ans))

### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)
import math
import fractions
import bisect

MOD = int(1e9+7)
PI = 3.14159265358979323846264338327950288

'''
1行のint
N, K = map(int, input().split())

1行のstring
S, T = input().split()

1行の整数配列
P = list(map(int,input().split()))

改行ありl
x = []
y = []
for i in range(5):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)

'''


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

ans = 0
for i in range(1, int(math.sqrt(M))+1):

    if M < i*N:
        break

    if M % i == 0:
        if M >= (M//i)*N:
            ans = M//i
            break

        ans = i



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

import pprint
import itertools
import collections
n, x, y = (int(each) for each in input().split(' '))

table1 = [[0] * n for i in range(n)]
table2 = [[0] * n for i in range(n)]
table_shortest = [[0] * n for i in range(n)]
cntr = {}

# 点iから点jまでの距離をテーブルにする

# 抜け道を通らないルートの場合
for i in range(n):
    for j in range(n):
        if j-i > 0:
            table1[i][j] = j-i

# 抜け道を通るルートの場合
for i in range(n):
    for j in range(n):
        if j-i > 0:
            table2[i][j] = abs(j-y+1)+abs(i-x+1)+1

# どちらか近いほうのルートが最短距離
for i in range(n):
    for j in range(n):
        if j-i > 0:
            table_shortest[i][j] = min(table1[i][j], table2[i][j])

# テーブルをflattenして数をかぞえる
cntr = collections.Counter(list(itertools.chain.from_iterable(table_shortest)))

cntr = dict(cntr)
for each in range(1,n):
    print(cntr.get(each, 0))

### FIXED CODE ###

import pprint
from itertools import chain
import collections
n, x, y = (int(each) for each in input().split(' '))

# table1 = [[0] * n for i in range(n)]
# table2 = [[0] * n for i in range(n)]
table = [[0] * n for i in range(n)]
# cntr = {}

# # 点iから点jまでの距離をテーブルにする

# # 抜け道を通らないルートの場合
# for i in range(n):
#     for j in range(n):
#         if j-i > 0:
#             table1[i][j] = j-i

# # 抜け道を通るルートの場合
# for i in range(n):
#     for j in range(n):
#         if j-i > 0:
#             table2[i][j] = abs(j-y+1)+abs(i-x+1)+1

# どちらか近いほうのルートが最短距離
for i in range(n):
    for j in range(i, n):
        if j-i > 0:
            table[i][j] = min(j-i, abs(j-y+1)+abs(i-x+1)+1)

# テーブルをflattenして数をかぞえる
cntr = collections.Counter(list(chain.from_iterable(table)))

# cntr = dict(cntr)
for each in range(1,n):
    print(cntr.get(each, 0))
### BUGGY CODE ###

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, m = na()
als = na()
ls = []
for i in range(m):
    b, c = na()
    ls.append([b, c])
ls.sort(key=lambda x: x[1], reverse=True)
als.sort()
while len(ls) > 0:
    m = als[0]
    if ls[0][0] == 0:
        ls.pop(0)
        if len(ls) == 0:
            break
    if m < ls[0][1]:
        als.remove(m)
        als.append(ls[0][1])
        ls[0][0] -= 1
    else:
        break
print(sum(als))

### FIXED CODE ###

import sys
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


n, m = na()
a = na()
bcs = []
for i in range(m):
    bcs.append(na())
for i in range(n):
    bcs.append([1, a[i]])
bcs.sort(key=itemgetter(1))

ans = 0
rem = n
for i in range(m+n-1, -1, -1):
    use = min(rem, bcs[i][0])
    ans += use*bcs[i][1]
    rem -= use

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

from collections import defaultdict

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)]

dp = defaultdict(set)
dp[(0, 0)].add(abs(A[0][0] - B[0][0]))
for i in range(H):
    for j in range(W):
        d = abs(A[i][j] - B[i][j])
        if i > 0:
            for k in dp[(i - 1, j)]:
                dp[(i, j)].add(abs(k + d))
                dp[(i, j)].add(abs(k - d))
        if j > 0:
            for k in dp[(i, j - 1)]:
                dp[(i, j)].add(abs(k + d))
                dp[(i, j)].add(abs(k - d))
print(min(dp[(H - 1, W - 1)]))


### 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)]

dp = [[0] * W for i in range(H)]
dp[0][0] = 1 << (abs(A[0][0] - B[0][0]) + 6400)
for i in range(H):
    for j in range(W):
        d = abs(A[i][j] - B[i][j])
        if i > 0:
            dp[i][j] |= dp[i - 1][j] << d | dp[i - 1][j] >> d
        if j > 0:
            dp[i][j] |= dp[i][j - 1] << d | dp[i][j - 1] >> d
ans = 0
res = dp[H - 1][W - 1] >> 6400
while res & 1 == 0:
    res >>= 1
    ans += 1
print(ans)
### BUGGY CODE ###

n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [tuple(map(int, raw_input().split())) for i in range(m)]
for b,c in y:
  while x[b-1] > c and b > 0:
    b -= 1
  x[0:b] = [c]*b
  x.sort()
print(sum(x))

### FIXED CODE ###

n, m = tuple(map(int, raw_input().split()))
x = sorted(list(map(int, raw_input().split())))
y = [list(map(int, raw_input().split())) for i in range(m)]
y.sort(key = lambda x: x[1], reverse=True)
y_pos = 0
for index, value in enumerate(x):
  b = y[y_pos][0]
  c = y[y_pos][1]
  if value < c:
	  x[index] = c
	  y[y_pos][0] = b-1
	  if b == 1:
		  y_pos += 1
		  if y_pos == len(y):
			  break
  else:
	  break

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


n= int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    a_n = a[:i]+a[i+1:]
    print(max(a_n))
    
    

### FIXED CODE ###


n= int(input())
a = [int(input()) for i in range(n)]
a_s = sorted(a,reverse=True)

for i in range(n):
    ans = a_s[0]
    if a[i]==a_s[0]:
        ans = a_s[1]
    
    print(ans)
### BUGGY CODE ###

H, W, K = map(int, input().split())
S = []
for _ in range(H):
  S.append(input())
hsummation = [[int(S[0][k])]for k in range(W)]
for k in range(W):
  for j in range(1, H):
    hsummation[k].append(hsummation[k][j-1] + int(S[j][k]))
#print(hsummation)
ans = float('inf')
anskouho = 0
h = -1
for j in range(2**(H-1)):
  h += 1
  binh = "0"*(H-len(str(bin(h)))+1)+str(bin(h))[2:]
  hlist=[]
  for k in range(H-1):
    if binh[-k-1] == '1':
      hlist.append(k)
  hlist.append(-1)
  #print(hlist)
  anskouho = len(hlist)-1
  if anskouho > ans:
    break
  now = 0
  while now < W:
    counter = [0 for _ in range(len(hlist))]
    while now < W:
      for l in range(len(hlist)):
        if l == 0:
          counter[l] += hsummation[now][int(hlist[l])]
          continue
        else:
          counter[l] += - hsummation[now][hlist[l-1]] + hsummation[now][hlist[l]]
      if max(counter) > K:
        anskouho += 1
        break
      else:
        now += 1
    if anskouho > ans:
      break
  else:
    ans = min(ans, anskouho)
 
      #print(counter)
#print(anskouho)
print(ans)

### FIXED CODE ###

H, W, K = map(int, input().split())
S = []
for _ in range(H):
  S.append(input())
hsummation = [[int(S[0][k])]for k in range(W)]
for k in range(W):
  for j in range(1, H):
    hsummation[k].append(hsummation[k][j-1] + int(S[j][k]))
#print(hsummation)
ans = float('inf')
anskouho = 0
h = 2**(H-1)
for j in range(2**(H-1)):
  h -= 1
  binh = "0"*(H-len(str(bin(h)))+1)+str(bin(h))[2:]
  hlist=[]
  for k in range(H-1):
    if binh[-k-1] == '1':
      hlist.append(k)
  hlist.append(-1)
  #print(hlist)
  anskouho = len(hlist)-1
  now = 0
  while now < W:
    counter = [0 for _ in range(len(hlist))]
    while now < W:
      for l in range(len(hlist)):
        if l == 0:
          counter[l] += hsummation[now][int(hlist[l])]
          continue
        else:
          counter[l] += - hsummation[now][hlist[l-1]] + hsummation[now][hlist[l]]
      if max(counter) > K:
        anskouho += 1
        break
      else:
        now += 1
    if anskouho > ans:
      break
  else:
    ans = min(ans, anskouho)
 
      #print(counter)
#print(anskouho)
print(ans)
### BUGGY CODE ###

s = input()
K = int(input())
dic = {}
sets = set()
for i in range(len(s)):
    sets.add(s[i])
    if s[i] not in dic:
        dic[s[i]] = [i]
    else:
        dic[s[i]].append(i)
sets = list(sets)
sets.sort()
ans = set()
c = 0
while(K > len(ans)):
    for i in dic[sets[c]]:
        for j in range(i + 1, len(s) + 1):
            ans.add(s[i:j])
    c += 1
ans = list(ans)
ans.sort()
print(ans[K - 1])

### FIXED CODE ###

s = input()
K = int(input())
sub = set()
for i in range(len(s)):
    for j in range(i+1, len(s)+1):
        if j - i > 5:
            break
        sub.add(s[i:j])
sub = list(sub)
sub.sort()
print(sub[K-1])
### BUGGY CODE ###

n=int(input())
lisa=[]
ans=0
for i in range(n):
    a=int(input())
    if a in lisa:
        lisa.remove(a)
        ans-=1
    else:
        lisa.append(a)
        ans+=1

print(ans)


### FIXED CODE ###

n=int(input())
s=set()
for i in range(n):
    a=int(input())
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n=int(input())
a=[0]*n
for i in range(n):
    a[i]=int(input())

for i in range(n):
    print(max(a[:i]+a[i+1:]))

### FIXED CODE ###

import sys
input = sys.stdin.readline
n=int(input())
a=[0]*n
for i in range(n):
    a[i]=int(input())
b=sorted(a)

for i in range(n):
    if a[i]!=b[-1]:
        print(b[-1])
    else:
        print(b[-2])
### BUGGY CODE ###


n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
  ans*=i
if ans <= 10**18:
  print(ans)
else:
  print(-1)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 in a:
  print(0)
else:  
  for i in a:
    ans*=i
    if ans > 10**18:
      print(-1)
      exit()
  print(ans)
### BUGGY CODE ###

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

M = [sum(P[i:i+K]) / 2 + K/2 for i in range(N-K+1)]

print(max(M))


### FIXED CODE ###

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

M = [sum(P[:K]) / 2 + K / 2]

for i in range(1, N-K+1):
    M.append(M[i-1] - P[i-1]/2 + P[i-1+K]/2)


print(max(M))
### BUGGY CODE ###

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

print_str = ''

for i in range(N):
    if i != N-1:
        print_str += str(A.index(i+1)+1) + ' '
    else:
        print_str += str(A.index(i+1)+1)
    
print(print_str)




### FIXED CODE ###

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

student = [0] * N
for i in range(N):
  student[A[i]-1] = i + 1
  
print(' '.join(map(str, student)))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
A_set = set(A)
Q = int(input())
dis_list = []
count = {}
temp_sum = 0
for a in A_set:
    count[a] = A.count(a)
    temp_sum += a * count[a]
for i in range(Q):
    s = list(map(int, input().split()))
    dis_list.append(s)
for j in dis_list:
    if j[0] in count:
        temp_sum += (j[1] - j[0])* count[j[0]]
        if j[1]in count:
            count[j[1]] += count[j[0]]
        else:
            count[j[1]] = count[j[0]]
        count[j[0]] = 0
    print(temp_sum)

### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
count = Counter(A) #not dict!!
temp_sum = sum(A)
for _ in range(Q):
    before, after = map(int, input().split())
    temp_sum += (after - before) * count[before]
    count[after] += count[before]
    count[before] = 0
    print(temp_sum)
### BUGGY CODE ###

def check(a,b):
    if b == 0 :
        return a
    return check(b,a%b)
def check2(x,y):
    for i in range(2,min(x,y)+1):
        if x % i == 0 and y % i == 0 :
            return i
A,B = map(int,input().split())
memo = [1]
ans = 1
while True :
    if check(A,B)== 1 :
        break
    p = check2(A,B)
    if p not in memo:
        memo.append(p)
        ans += 1
    A = (A//p)
    B = (B//p)


print(ans)

### FIXED CODE ###

def gcd(x, y):
    if y == 0 :
        return x
    else:
        return gcd(y,x%y)
def prime(x):
    global  ans
    m = x ** (0.5)
    for i in range(2,int(m+1)):
        if x % i == 0 :
            while True:
                if x % i != 0 :
                    break
                else:
                    x = (x//i)
            ans +=1
    if x != 1 :
        ans += 1
    return ans
A,B = map(int,input().split())
t = gcd(A,B)
ans = 1
print(prime(t))
### BUGGY CODE ###

s = input()
if len(set(s))==1:
    print(0)
else:
    count = 0
    while True:
        if s[-1]=='W':
            k = 0
            for i in range(-1,len(s)*(-1),-1):
                if s[i]=='B':
                    k = i
                    break
            s = s[0:k+1]+'B'*(k*(-1))+'B'
            count+=1
        elif s[-1]=='B':
            k = 0
            for i in range(-1,len(s)*(-1),-1):
                if s[i]=='W':
                    k = i
                    break
            s = s[0:k+1]+'W'*(k*(-1))+'W'
            count+=1
        if len(set(s))==1:
            break
    print(count)

### FIXED CODE ###

s = input()
count = 0
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        count+=1
print(count)
### BUGGY CODE ###

def addbit(i):
    i += 1
    while i <= N:
        BIT[i] += 1
        i += i & (-i)
def getsum(i):
    ret = 0
    i += 1
    while i != 0:
        ret += BIT[i]
        i -= i&(-i)
    return ret
def bit(L):
    global BIT
    BIT=[0] * (N+1)
    re = 0
    for l in L:
        re += getsum(l)
        addbit(l)
    return N*(N-1)//2 - re
def calc(Z):
    Z.sort()
    l, r, lc, rc = -1<<28, 1<<28, N*(N-1)//4+1, N*(N-1)//4+1
    f = 1
    while (r - l) / max(abs(l), 1) > 0.000000001:
        m = (l+r) / 2 if f else (l * rc + r * lc) / (lc + rc)
        A = [b for a, b in sorted([(s*m+t, i) for i, (s, t) in enumerate(Z)])]
        c = bit(A)
        if c > N*(N-1)//4:
            l = m
            lc = (c - N*(N-1)//4) * 2
        else:
            r = m
            rc = (N*(N-1)//4 - c) * 2 + 1
        f ^= 1
    return l

N = int(input())
X, Y = [], []
for _ in range(N):
    a, b, c = map(int, input().split())
    X.append((-a/b, c/b))
    Y.append((-b/a, c/a))
print(calc(X), calc(Y))

### FIXED CODE ###

def addbit(i):
    i += 1
    while i <= N:
        BIT[i] += 1
        i += i & (-i)
def getsum(i):
    ret = 0
    i += 1
    while i != 0:
        ret += BIT[i]
        i -= i&(-i)
    return ret
def bit(L):
    global BIT
    BIT=[0] * (N+1)
    re = 0
    for l in L:
        re += getsum(l)
        addbit(l)
    return N*(N-1)//2 - re
def calc(Z):
    Z.sort()
    l, r, lc, rc = -1<<28, 1<<28, N*(N-1)//4+1, N*(N-1)//4+1
    f = 1
    while (r - l) / max(abs(l), 1) > 0.000000001:
        m = (l+r) / 2 if f else (l * rc + r * lc) / (lc + rc)
        A = [a&((1<<16)-1) for a in sorted([(int((s*m+t)*2**40)<<16)+i for i, (s, t) in enumerate(Z)])]
        c = bit(A)
        if c > N*(N-1)//4:
            l = m
            lc = (c - N*(N-1)//4) * 2
        else:
            r = m
            rc = (N*(N-1)//4 - c) * 2 + 1
        f ^= 1
    return l

N = int(input())
X, Y = [], []
for _ in range(N):
    a, b, c = map(int, input().split())
    X.append((-a/b, c/b))
    Y.append((-b/a, c/a))
print(calc(X), calc(Y))