Harryxun/stf_run huggingface dataset:
l = [e in e in input().split()]
c = 0
if l[1] == "R":
  c += 1
  if l[0] == "R":
    c += 1
  if l[2] == "R":
  	c += 1
else:
  if l[0] == 1 or l[2] == "R":
    c += 1

print(c)


### FIXED CODE ###

a, b, c = input()

if b == "R":
  d = 1
  if a == "R":
    d += 1
  if c == "R":
  	d += 1
else:
  d = 0
  if a == "R" or c == "R":
    d += 1
 
print(d)
import sys
P = 0
N,M = map(int,input().strip().split())
if M == 0:
    print("{0} {1}".format(0,P))
    sys.exit()
ans_list = [list(input().strip().split()) for _ in range(M)]
result = [False] * N
for ans in ans_list:
    if result[int(ans[0])-1] != True
        if ans[1] == "WA":
            P += 1
        elif ans[1] == "AC":
            result[int(ans[0])-1] = True
print("{0} {1}".format(result.count(True),P))

### FIXED CODE ###

import sys
P = 0
N,M = map(int,input().strip().split())
if M == 0:
    print("{0} {1}".format(0,0))
    sys.exit()
ans_list = [list(input().strip().split()) for _ in range(M)]
result = [False] * N
wa_count = [0] * N
for ans in ans_list:
    if result[int(ans[0])-1] != True:
        if ans[1] == "WA":
            wa_count[int(ans[0])-1] += 1
        elif ans[1] == "AC":
            result[int(ans[0])-1] = True
for i in range(len(result)):
    if result[i] == True:
        P += wa_count[i]
print("{0} {1}".format(result.count(True),P))
N = int(input())
S = input()
r = s.count('R')
b = s.count('B')
msg = 'Yes' if r > b else 'No'
print(msg)

### FIXED CODE ###

N = int(input())
S = input()
r = S.count('R')
b = S.count('B')
msg = 'Yes' if r > b else 'No'
print(msg)
n = int(input())
if n//111 = n/111:
  print(n)
else:
  print(((n//111)+1) * 111)

### FIXED CODE ###

a = int(input())
print(a if a % 111 == 0 else 111 * (1 + a // 111))
n = int(input())
ls = []
for i in range(n):
    a = int(input())
    p = []
    for i in range(a):
        x,y = map(int,input().split())
        p.append([x-1,y])
    ls.append(p)

ans = 0

for i in range(2**n):
    flag = 0
    for j in range(n):
        if (i >> j) & 1:#もし正直者だったら
            for k in ls[j]:#証言の確認
                if (i >> k[0])&1 != k[1]:#もし証言がおかしかったら
                    flag = 1
                    break
    if flag == 0:
        ans = max(ans, bin(i)[2:].count(1))
print(ans)

### FIXED CODE ###

n = int(input())
ls = []
for i in range(n):
    a = int(input())
    p = []
    for i in range(a):
        x,y = map(int,input().split())
        p.append([x-1,y])
    ls.append(p)

ans = 0

for i in range(2**n):
    flag = 0
    for j in range(n):
        if (i >> j) & 1:
            for k in ls[j]:
                if (i>>k[0])&1 != k[1]:
                    flag = 1
                    break
    if flag == 0:
        ans = max(ans, bin(i)[2:].count('1'))
print(ans)
input_AP = list(map(int, input().split()))
print(result)

### FIXED CODE ###


N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = list(map(str,input().split()))
for i in range(N):
    A[i].append(str(i+1))
for i in range(N):
    A[i][1] = int(A[i][1]) 


B = sorted(A, key=lambda x: x[1], reverse=True)

C = sorted(B, key=lambda x: x[0])

for i in range(N):
    print(int(C[i][2]))
n,k = map(int,input().split())
lr = []
for _ in range(k):
  lr.append(list(map(int,input().split())))
#print(lr)
imos = [0 for _ in range(n)]
imos[0] = 1
imos[1] = -1
now = 0
mod = 998244353
for i in range(n):
    now += imos[i]
    now %= mod
    #print(now)
    for j in range(k):
        try:
            imos[i+lr[j][0]] += now
            imos[i+lr[j][0]] %= mod
        except:
            pass
        try:
            imos[i+lr[j][1]+1] -= now
            imos[i+lr[j][1]+1] %= mod
        except:
            pass
    #print(imos)
print(now)

### FIXED CODE ###

s = input()
if s[-1] == 's':
  print(s + 'es')
else:
  print(s + 's')
N = input()
if "9" in N:
  print("Yes")
else:
  print("No)

### FIXED CODE ###

N = input()
if "9" in N:
  print("Yes")
else:
  print("No")
import math


def main():
    X = int(input())

    MAX = int(math.pow(10 ** 10, 1 / 5))

    for b in range(0, MAX + 1):
        # b = 1,2,3...
        a = math.pow(abs(b ** 5 + X), 1 / 5)
        # print(f'b={b} a={a}')
        if a == int(a):
            if b ** 5 + X > 0:
                print(int(a), b)
            else:
                print(-int(a), b)
            return

        # b = -1, -2, -3
        a = math.pow(abs(- b ** 5 + X), 1 / 5)
        # print(f'b={-b} a={a}')
        if a == int(a):
            if - b ** 5 + X > 0:
                print(int(a), b)
            else:
                print(-int(a), b)
            return

    raise ValueError()


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math


def main():
    X = int(input())

    MAX = 10 ** 9

    for b in range(0, MAX + 1):
        # b = 1,2,3...
        a = math.pow(abs(b ** 5 + X), 1 / 5)
        # print(f'b={b} a={a}')
        # print(f'b={b} a={a}')
        if round(a) ** 5 == abs(b ** 5 + X):
            if b ** 5 + X > 0:
                print(int(a), b)
                return
            else:
                print(-int(a), b)
                return

        # b = -1, -2, -3
        a = math.pow(abs(- b ** 5 + X), 1 / 5)
        # print(f'b={-b} a={a}')
        if round(a) ** 5 == abs(- b ** 5 + X):
            if - b ** 5 + X > 0:
                print(int(a), -b)
                return
            else:
                print(-int(a), -b)
                return

    raise ValueError()


if __name__ == '__main__':
    main()
import sys
readline = sys.stdin.readline
_input = sys.stdin.readlines()
if len(_input) < 2:
    print("In preparation.")
    exit()
n = int(_input[0])
li = list(map(int, _input[1]))
def largest_histogram(histogram):
    if len(histogram) == 0: return 0
    histogram = list(histogram)
    max_h = max(n, max(histogram))
    for i in range(n):
        for j in range(2, histogram[i] + 1):
            m = 1
            for k in range(i + 1, n):
                if histogram[k] >= j:
                    m += 1
                else:
                    break
            if max_h < j * m:
                max_h = j * m
    return max_h
print(largest_histogram(li))

### FIXED CODE ###

import sys
from collections import deque
readline = sys.stdin.readline
n = int(readline())
li = list(map(int, readline().split()))
def square(P):
    G = []
    L = deque()
    for i, v in enumerate(P):
        if not L:
            L.append((i, v))
            continue
        if v > L[-1][1]:
            L.append((i, v))
        elif v < L[-1][1]:
            k = i - 1
            while L and v < L[-1][1]:
                a = L.pop()
                G.append((k - a[0] + 1) * a[1])
            L.append((a[0], v))
    while L:
        a = L.pop()
        G.append((n - a[0]) * a[1])
    return max(G)
print(square(li))
r=I()
print(3*r*r)
 

### FIXED CODE ###

import sys
input = sys.stdin.readline
import math
import collections
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

r=I()
print(3*r*r)
import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

b = np.zeros(K, int)
for j in range(K):
    b[j] = a[max(i-(j+1),0)] + abs(hs[i] - hs[max(i-(j+1),0)])
    
for i in range(2, N):
    
    b = np.hstack((b[1:], np.array([a[max(i-1,0)] + abs(hs[i] - hs[max(i-1,0)])])))
    a[i] = np.min(b)
print(a[-1])

### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

a = np.zeros(N, int)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

if N == 2:
    print(a[-1])
else:
    for i in range(2, N):
        b = a[max(i-K,0):i] + np.abs(hs[i] - hs[max(i-K,0):i])
        a[i] = np.min(b)
    print(a[-1])
# Ai>=Bi 出来るならそのままにする
# Ai < Bi 仕方ないので溢れたぶんを使う
# 「変更したAi」の最小値が欲しいので、使うのは余ってるやつが多い順に使ったほうがいい

n = int(input())
arr = list(map(int, input().split()))
brr = list(map(int, input().split()))

lack, lack_i = 0, []
extra, extra_i = 0, []
for i in range(n):
    if arr[i] < brr[i]:
        lack += brr[i] - arr[i]
        lack_i.append([i, brr[i] - arr[i]])
    else:
        extra += arr[i] - brr[i]
        extra_i.append([i, arr[i] - brr[i], False])

if lack > extra:
    print(-1)
    exit()

# 大量に余っているやつから優先的に使う
extra_i = list(sorted(extra_i, key=lambda x: x[1], reverse=True))
ans = 0

l_i = 0
e_i = 0

while True:
    if l_i >= len(lack_i):
        break
    while True:
        if lack_i[l_i][1] <= extra_i[e_i][1]:
            extra_i[e_i][2] = True  # 一回でも使用した
            ans += 1  #
            extra_i[e_i][1] -= lack_i[l_i][1]
            break
        else:
            extra_i[e_i][2] = True  # 一回でも使用した
            e_i += 1
            lack_i[l_i][1] -= extra_i[e_i][1]
            extra_i[e_i][1] = 0
        if e_i > len(extra_i):
            break  # ここにくるときがよくわからんけど
    l_i += 1

bonus = len(list(filter(lambda x: x[2] == True, extra_i)))
print(ans + bonus)


### FIXED CODE ###

# にぶたんが失敗したので両端からしゃくとりするような感じでやってみる
# 差分でソートして大きく足りないものは大きく余ってるやつをぶつける

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
if sum(A) < sum(B):
    print(-1)
    exit()
D = []
pre_ans = 0  # 確実に変えなくてはいけないやつ
for i in range(N):
    if A[i] != B[i]:
        D.append(A[i] - B[i])
        if A[i] < B[i]:
            pre_ans += 1
D = sorted(D)

used = 0
tmp = 0
# print(D)
l, r = 0, len(D)
while r - l > 1:
    # print("now tmp: {}".format(tmp))
    if tmp + D[l] < 0:
        # 新たに借りる
        r -= 1
        used += 1
        tmp += D[r]
    tmp += D[l]
    l += 1
print(used + pre_ans)
s= input()
s[3]="8"
print(s)

### FIXED CODE ###

s = input()
print("2018/01/"+s[8:])
# """
# コンプリートするものと、せざるものに分ける
# コンプリートしないものに関しては、得点の高い方から一個だけ潰す
# """

D, G = map(int, input().split())
ps_ini,cs = [], []
for i in range(D):
    p,c = map(int,input().split())
    ps_ini.append(p)
    cs.append(c)
q_min = 1000000
for i in range(2**D):
    Gtmp = G
    ps = [p for p in ps_ini]
    s = "{:05b}".format(i)[::-1]
    q_all = 0
    for j,(p,c) in enumerate(zip(ps,cs)):
        # ボーナスの考慮
        Gtmp -= (p*(j+1)*100+c)*int(s[j]) 
        q_all += p*int(s[j])
        ps[j] -= p*int(s[j])
    # print(s,ps)
    if Gtmp <= 0:
        q_min = min(q_min, q_all)
    else:
        # コンプしていない問題で一番大きいやつ
        ind = 0
        for i,p in enumerate(ps):
            if p != 0:
                ind = i
        # print(Gtmp,ind,Gtmp//((ind+1)*100))
        # 比較
        if Gtmp//((ind+1)*100) > ps[ind]:
            continue
        if Gtmp%((ind+1)*100) == 0:           #割り切れない
            q_all += (Gtmp//((ind+1)*100))
        else:                           #割り切れる
            q_all += (Gtmp//((ind+1)*100) + 1) #最大値をコンプする以外ありえん
        q_min = min(q_min, q_all)
print(q_min)

### FIXED CODE ###

# """
# コンプリートするものと、せざるものに分ける
# コンプリートしないものに関しては、得点の高い方から一個だけ潰す
# """

D, G = map(int, input().split())
ps_ini,cs = [], []
for i in range(D):
    p,c = map(int,input().split())
    ps_ini.append(p)
    cs.append(c)

q_min = 1000000
for i in range(2**D):
    Gtmp = G
    ps = [p for p in ps_ini]
    s = "{:010b}".format(i)[::-1]
    q_all = 0
    for j,(p,c) in enumerate(zip(ps,cs)):
        # ボーナスの考慮
        Gtmp -= (p*(j+1)*100+c)*int(s[j]) 
        q_all += p*int(s[j])
        ps[j] -= p*int(s[j])
    # print(s,ps)
    if Gtmp <= 0:
        q_min = min(q_min, q_all)
    else:
        # コンプしていない問題で一番大きいやつ
        ind = 0
        for i,p in enumerate(ps):
            if p != 0:
                ind = i
        # print(Gtmp,ind,Gtmp//((ind+1)*100))
        # 比較
        if Gtmp//((ind+1)*100) > ps[ind]:
            continue
        if Gtmp%((ind+1)*100) == 0:           #割り切れない
            q_all += (Gtmp//((ind+1)*100))
        else:                           #割り切れる
            q_all += (Gtmp//((ind+1)*100) + 1) #最大値をコンプする以外ありえん
        q_min = min(q_min, q_all)
print(q_min)
n, x = map(int, input().split())
m = []
for i in range(n):
  m.append(int(input()))

x -= sum(m)
count = x // min(x) + n
print(count)

### FIXED CODE ###

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

x -= sum(m)
count = x // min(m) + n
print(count)
N,K,S = map(int, input().split())

sa = N-K+1
a = [1 for i in range(N)]
if S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        if sa != 0:
            j %= sa

    for x in a:
        print(x, end = " ")


else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")

### FIXED CODE ###

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

sa = N-K+1
a = [1 for i in range(N)]
if S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        if i < N:
    
            a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        j %= sa

    for x in a:
        print(x, end = " ")


else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i != n:
        if i+1 == l[i]:
            a = l[i]
            b = l[i+1]
            l[i]=b
            l[i+1]=a
            ans += 1
    else:
        if i+1 == l[i]:
            ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i+1 == a[i] and i != n-1:
        b = a[i]
        c = a[i+1]
        a[i] = c
        a[i+1] = b
        ans += 1
    elif i+1 == a[i]:
        ans += 1
print(ans)
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
tmp = 0
for a range(1, k+1):
  for b range(1, k+1):
    for c range(1, k+1):
      tmp += gcd_list([a, b, c])
print(tmp)

### FIXED CODE ###

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
tmp = 0
for a in range(1, k+1):
  for b in range(a, k+1):
    for c in range(b, k+1):
      #print('a='+str(a)+', b='+str(b)+', c='+str(c))
      if a == b and a == c:
        tmp += gcd_list([a, b, c]) 
      elif a == b and a != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      elif b == c and a != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      elif a == c and b != c:
        tmp += gcd_list([a, b, c]) * 3
#        tmp += gcd_list([b, c, a]) 
#        tmp += gcd_list([c, a, b]) 
      else:
        tmp += gcd_list([a, b, c]) * 6
#        tmp += gcd_list([a, c, b])
#        tmp += gcd_list([b, a, c])
#        tmp += gcd_list([b, c, a])
#        tmp += gcd_list([c, a, b])
#        tmp += gcd_list([c, b, a])
print(tmp)
import sys
sys.setrecursionlimit(4000)

def dfs(now):
  for i in edge[now]:
    point[i]+=point[now]
    dfs(i)

n,q=map(int,input().split())
edge=[[] for _ in range(n)]
point=[0]*n
for i in range(n-1):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
for i in range(q):
  p,x=map(int,input().split())
  point[p-1]+=x
dfs(0)
print(*point)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000)
n,q=map(int,input().split())
e=[[] for _ in range(n)]
cnt=[0]*n
for _ in range(n-1):
  a,b=map(int,input().split())
  e[a-1].append(b-1)
  e[b-1].append(a-1)
for _ in range(q):
  x,y=map(int,input().split())
  cnt[x-1]+=y
vis=[1]*n
queue=[0]
vis[0]=0
while queue:
  now=queue.pop()
  for i in e[now]:
    if vis[i]:
      queue.append(i)
      cnt[i]+=cnt[now]
      vis[i]=0
print(' '.join(map(str,cnt)))
import sys
inputs = sys.stdin.readline
N, Q= map(int,inputs().split())
V = [None]*N
E = []
for n in range(N):
	V[n] = list(map(int,inputs().split()))
	V[n][0] -= V[n][2]
	V[n][1] -= V[n][2]
	E.append([V[n][0],1,V[n][2]])
	E.append([V[n][1],-1,V[n][2]])
D = [int(inputs()) for p in [0]*Q]
E.sort(key = lambda x:x[0])
E.append([1000000001,0,1000000001])
mini = 1000000001
kouho = [1000000001]
q = 0
d = D[0]
for e in E:
	flag = 0
	if e[0] <= d:
		if  e[1] == 1:
			kouho.append(e[2])
		elif e[1] == -1:
			kouho.remove(e[2])
	if e[0] > d:
		for k in kouho:
			mini = min(k,mini)
		if mini < 1000000001:
			print(mini)
			mini = 1000000001
		else:
			print(-1)
			mini = 1000000001
		flag = 1
		if q < Q-1:
			q = q + 1
			d = D[q]
		else:
			break
	if e[0] <= d and flag == 1:
		if  e[1] == 1:
			kouho.append(e[2])
		elif e[1] == -1:
			kouho.remove(e[2])
for t in [None]*(Q-q-1):
	print(-1)

### FIXED CODE ###

import sys
from operator import itemgetter
def main():
	inputs = sys.stdin.readline
	N, Q= map(int,inputs().split())
	E = [None]*2*N
	for n in range(N):
		a,b,c = map(int,inputs().split())
		E[2*n] = (a - c, 1, c)
		E[2*n + 1] = (b - c, -1, c)
	E.sort(key=itemgetter(0))
	tuple(tuple(E))
	mini = 1000000001
	kouho = {1000000001}
	my_add = kouho.add
	my_discard = kouho.discard
	q = 0
	d = int(inputs())
	flag = False
	cont = False
	for e in E:
		while e[0] > d:
			if cont == True:
				print(mini-(mini//1000000001)*1000000002)
			else:
				mini = min(kouho)
				print(mini-(mini//1000000001)*1000000002)
			cont = True
			q = q + 1
			if q > Q-1:
				flag = True
				break
			d = int(inputs())
		if flag == True:
			break
		if e[1] == 1:
			my_add(e[2])
			if mini > e[2]:
				mini = e[2]
		elif e[1] == -1:
			my_discard(e[2])
			if mini == e[2]:
				cont = False
	for t in [None]*(Q-q):
		print(-1)
main()
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
ABs = []
for _ in range(N):
    A,B = inpl()
    ABs.append([A+B,A,B])

ABs.sort(reversed=True)
t = a = 0

for i,[AB,A,B] in enumerate(ABs):
    if i%2 == 0:
        t += A
    else:
        a += B

print(t-a)


### FIXED CODE ###

N = int(input())
ABs = [list(map(int,input().split())) for i in range(N)]
li = []
for A,B in ABs:
  li.append([A+B,A,B])
  
li.sort(reverse=True)
flag = True
ans1 = ans2 = 0
for S,A,B in li:
  if flag:
    ans1 += A
  else:
    ans2 += B
  flag = not flag
  
print(ans1-ans2)
N = int(input())
xylist = [[0, 0]]*N
for i in range(N):
  xy = list(map(int, input().split()))
  xylist[i] = xy

dl = {}
for i in range(N):
  for j in range(i+1, N):
    dx = str(xylist[j][0] - xylist[i][0])
    dy = str(xylist[j][1] - xylist[i][1])
    l = dx + "|" + dy
    if dx == "0" and dy == "0":
      continue
    if l in dl:
      dl[l] = dl[l] + 1
    else:
      dl[l] = 1

print(N - max(dl.values()))

### FIXED CODE ###

N = int(input())
xylist = [[0, 0]]*N
for i in range(N):
  xy = list(map(int, input().split()))
  xylist[i] = xy

dl = {}
for i in range(N):
  for j in range(N):
    dx = str(xylist[j][0] - xylist[i][0])
    dy = str(xylist[j][1] - xylist[i][1])
    l = dx + "|" + dy
    if dx == "0" and dy == "0":
      continue
    if l in dl:
      dl[l] = dl[l] + 1
    else:
      dl[l] = 1

cnt = 0
if len(dl) != 0:
  cnt = N - max(dl.values())

print(cnt if cnt > 1 else "1")
N = input()
P = N**3
print(P)

### FIXED CODE ###

print(int(input())**3)
a, b, c, d = map(int, input())

print(max(a*b, c*d))

### FIXED CODE ###

a, b, c, d = map(int, input().split())

print(max(a*b, c*d))
H, W = map(int, input().split())
for i in range(H):
    S = input(split())
    for j in range(W):
        if S[j] == "snuke":
            print(chr(65+j) + str(i+1))

### FIXED CODE ###

H, W = map(int, input().split())
for i in range(H):
    S = input().split()
    for j in range(W):
        if S[j] == "snuke":
            print(chr(65+j) + str(i+1))
a = list(map(int,input().split()))
b = sorted(a)3 
if b = [5, 5, 7]:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a = list(map(int,input().split()))
b = sorted(a)
if b == [5, 5, 7]:
    print("YES")
else:
    print("NO")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from scipy.special import perm, comb

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

"""
d == 0
def expectation_0(n, m, d):
    return sum([i * comb(m-1, k) * (n/n**2)**k * (1 - n/n**2)**(m-1-k) for k in range(0, m-1)])

d != 0
def expectation_0(n, m, d):
    return sum([i * comb(m-1, k) * (2(n-d)/n**2)**k * (1 - 2(n-d)/n**2)**(m-1-k) for k in range(0, m-1)])
"""
def expectation(p, m):
        return sum([k * comb(m-1, k) * p**k * (1 - p)**(m-1-k) for k in range(0, m-1)])


if d == 0:
    p = 1 / n  # n / n**2
    print(expectation(p, m))

else:
    p = 2 * (n - d) / n**2
    print(expectation(p, m))


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

"""
from scipy.special import perm, comb

d == 0
def expectation_0(n, m, d):
    return sum([i * comb(m-1, k) * (n/n**2)**k * (1 - n/n**2)**(m-1-k) for k in range(0, m-1)])

d != 0
def expectation_0(n, m, d):
    return sum([i * comb(m-1, k) * (2(n-d)/n**2)**k * (1 - 2(n-d)/n**2)**(m-1-k) for k in range(0, m-1)])

def expectation(p, m):
        return sum([k * comb(m-1, k) * p**k * (1 - p)**(m-1-k) for k in range(0, m-1)])
"""
if d == 0:
    p = 1 / n  # n / n**2
    print((m - 1) * 1/n)

else:
    p = 2 * (n - d) / n**2
    print((m - 1) * p)
import sys
re = range(input())
for li in sys.stdin:
    [a,b] = [int(x) for x in li.split(",")]
    tmp = re[a-1]
    re[a-1] = re[b-1]
    re[b-1] = tmp
for i in re:
    print i+1

### FIXED CODE ###

import sys
l = range(input())
n = input()
for line in sys.stdin:
    [a,b] = [int(x) for x in line.split(',')]
    tmp = l[a-1]
    l[a-1] = l[b-1]
    l[b-1] = tmp
for i in l:
    print i+1
from sys import stdin

C = input()

print(chr(ord(C + 1)))

### FIXED CODE ###

from sys import stdin

C = input()
c = ord(C)

print(chr(c + 1))
X = int(input())
item = [100, 101, 102, 103, 104, 105]
dp = [[False for _ in range(X//100+4)] for _ in range(X+1)]
dp[0][0] = True
dp[100][1] = True
dp[101][1] = True
dp[102][1] = True
dp[105][1] = True
for x in range(100, X+1):
    for n in range(1, X//100+4):
        for i in item:
            if dp[x-i][n-1]:
                dp[x][n] = True
if True in dp[x]:
    print(1)
else:
    print(0)

### FIXED CODE ###

X = int(input())
dp = [False for _ in range(X+1)]
dp[0] = True
for x in range(X+1):
    if x > 99:
        item = [100, 101, 102, 103, 104, 105]
        for i in item:
            if dp[x-i]:
                dp[x] = True
if dp[X]:
    print(1)
else:
    print(0)
n = int(input())
output = []
for i in range(n):
    order,data = map(int,input().split())
#    if order == "insert":
#        output.append(int(data))
#    elif order == "deleteFirst":
#        output.pop()
#    elif order == "deleteLast":
#        output.popleft()

#   elif order == "delete":
#        try:
#            output.remove(int(data))
#        except:
#            pass
#output.reverse()
print(" ".join(output))
#print(" ".join(map(str,output)))

### FIXED CODE ###

import sys
from collections import deque
n = int(sys.stdin.readline())
lines = sys.stdin.readlines()
 
Q = deque()
for i in range(n):
    command = lines[i].split()
    if command[0] == "insert":
        Q.appendleft(command[1])
    elif command[0] == "deleteFirst":
        Q.popleft()
    elif command[0] == "deleteLast":
        Q.pop()
    elif command[0] == "delete":
        try:
            Q.remove(command[1])
        except:
            pass
print(" ".join(Q))
import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,n):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)

### FIXED CODE ###

import collections
n=int(input())
s=[]
for i in range(n):
  S=input()
  s.append(S)

c = collections.Counter(s)
l=c.most_common()
x=[l[0][0]]
for i in range(1,len(l)):
  if l[i-1][1]==l[i][1]:
    x.append(l[i][0])
  else:
    break
x.sort()    
for i in x:
  print(i)