Harryxun/stf_run huggingface dataset:
import numpy as np
from nltk.classify.maxent import calculate_empirical_fcount
N = int(input())
SList = []
PList = []
dic = {}
Slist = []
aa = []
for _ in range(N):
    S, P = input().split()
    dic[S] = int(P)
    Slist.append(S)
    aa.append((int(P), S))
dic = sorted(dic.items())

sortedS = list(sorted(set(Slist)))

for i in range(len(sortedS)):
    tempV = []
    tempI = []
    for j in range(N):
        if aa[j][1] == sortedS[i]:
            tempV.append(aa[j][0])
            tempI.append(j)
    indexList = np.argsort(tempV)
    for k in reversed(indexList):
        print(tempI[k] + 1)


### FIXED CODE ###

import numpy as np
N = int(input())
SList = []
PList = []
dic = {}
Slist = []
aa = []
for _ in range(N):
    S, P = input().split()
    dic[S] = int(P)
    Slist.append(S)
    aa.append((int(P), S))
dic = sorted(dic.items())

sortedS = list(sorted(set(Slist)))

for i in range(len(sortedS)):
    tempV = []
    tempI = []
    for j in range(N):
        if aa[j][1] == sortedS[i]:
            tempV.append(aa[j][0])
            tempI.append(j)
    indexList = np.argsort(tempV)
    for k in reversed(indexList):
        print(tempI[k] + 1)
n = int(input())
pre = list(map(int, input().split()))
ino = list(map(int, input().split()))

d = []
root = pre[1]
pre = iter(pre).__next__

def dfs(l, r):
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)



### FIXED CODE ###

n = int(input())
pre = list(map(int, input().split()))
ino = list(map(int, input().split()))

d = []
root = pre[0]
pre = iter(pre).__next__

def dfs(l, r):
    global d
    if l >= r:
        return
    c = pre()
    m = ino.index(c)
    dfs(l, m)
    dfs(m+1, r)
    d += [c]
    
dfs(0, len(ino))
print(*d)
c=input()
print(c+1)

### FIXED CODE ###

print(chr(ord(input())+1))
import sys
input=sys.stdin.readline

h = {}
for c in "MARCH":
    h[c] = 0

n = int(input())
for i in range(n):
    s = input().strip()
    h[s[0]] += 1
#print(h)

import itertools
ans = 0
for i,j,k in itertools.combinations("MARCH", 3):
    ans += h[i]*h[j]*h[k]
print(ans)


### FIXED CODE ###

import sys
input=sys.stdin.readline

n = int(input())
a = [0]*5
for i in range(n):
    s = input().strip()
    c = s[0]
    if c == "M":
        a[0] += 1
    elif c == "A":
        a[1] += 1
    elif c == "R":
        a[2] += 1
    elif c == "C":
        a[3] += 1
    elif c == "H":
        a[4] += 1
#print(a)

ans = 0
for i in range(0, len(a)-2):
    for j in range(i+1, len(a)):
        for k in range(j+1, len(a)):
#            print(i,j,k, a[i]*a[j]*a[k])
            ans += a[i]*a[j]*a[k]
print(ans)
import numpy as np

N = int(input())
hs = list(map(int, input().split()))
hs = [0] + hs

# init
# dp[stage][jump_num]
# stage: 1 ~ N, jump_num: 1 ~ N-1
dp = np.zeros((N + 1, N)).astype(int)
# loop
# stage
for i in range(1, N):
    # jump_num
    js = np.where(dp[i, :] > 0)[0]
    if len(js) == 0:
        js = [0]
    for j in js:
        # i + 1
        if dp[i + 1][j + 1] == 0:
            dp[i + 1][j + 1] = dp[i][j] + abs(hs[i + 1] - hs[i])
        else:
            dp[i + 1][j + 1] = min(dp[i][j] + abs(hs[i + 1] - hs[i]), dp[i + 1][j + 1])
        # i + 2
        if i < N - 1:
            if dp[i + 2][j + 1] == 0:
                dp[i + 2][j + 1] = dp[i][j] + abs(hs[i + 2] - hs[i])
            else:
                dp[i + 2][j + 1] = min(dp[i][j] + abs(hs[i + 2] - hs[i]), dp[i + 2][j + 1])

# output
vals = dp[N][dp[N] > 0]
if len(vals) == 0:
    print(0)
else:
    print(min(vals))

### FIXED CODE ###

import numpy as np

N = int(input())
hs = list(map(int, input().split()))
hs = [0] + hs

# init
dp = np.zeros(N + 1).astype(int)
dp[2] = abs(hs[2] - hs[1])
# loop
if N > 2:
    for i in range(3, N + 1):
        dp[i] = min(
            dp[i-2] + abs(hs[i] - hs[i-2]),
            dp[i-1] + abs(hs[i] - hs[i-1]))

# output
print(dp[N])
import operator

#リスト内包表記
N = int(input())
A = [int(x) for x in input().split()]

#リストの総積を計算する
seki = reduce(operator.mul, A, 1)

if seki > 10**18:
    print("-1")
else:
    print(seki)

### FIXED CODE ###

A,B = map(int, input().split())
print(A*B)
def slove():
    import sys
    input = sys.stdin.readline
    h, w, a, b = list(map(int, input().rstrip('\n').split()))
    for i in range(h):
        if i < b:
            print("".join(["0"] * a + ["1"] * (w - a)))
        else:
            print("".join(
    slove()


### FIXED CODE ###

def slove():
    import sys
    input = sys.stdin.readline
    h, w, a, b = list(map(int, input().rstrip('\n').split()))
    for i in range(h):
        if i < b:
            print("".join(["0"] * a + ["1"] * (w - a)))
        else:
            print("".join(["1"] * a + ["0"] * (w - a)))


if __name__ == '__main__':
    slove()
import sys
inputs = sys.stdin.readline
def main():
	ans = 1
	a = 0
	b = 0
	flg2 = 0
	N, M = map(int,inputs().split())
	A =[0]*(M+1)
	for i in range(M):
		a = int(inputs())
		A[i] = a-1-b
		b = a + 1
	A[M] = N - b
	A.sort()
	if A [0] < 0:
		print(0)
		flg2 = 1
	p = 1
	q = 1
	t = 0
	flg = 0
	while (A[t]<2):
		t = t+1
	if t > M:
		print(0)
		flg2 = 1
	for k in range(2,N+1):
		r = p + q
		p = q
		q = r
		while (A[t] == k):
			ans = ans*r%1000000007
			t += 1
			if t == M+1:
				flg = 1
				break
		if flg == 1:
			break
	if flg2 == 0:
		print(ans%1000000007)
main()

### FIXED CODE ###

import sys
inputs = sys.stdin.readline
def main():
	ans = 1
	a = 0
	b = 0
	flg2 = 0
	N, M = map(int,inputs().split())
	A =[0]*(M+1)
	for i in range(M):
		a = int(inputs())
		A[i] = a-1-b
		b = a + 1
	A[M] = N - b
	A.sort()
	if A [0] < 0:
		flg2 = 1
	p = 1
	q = 1
	t = 0
	flg = 0
	while (A[t]<2):
		t = t+1
		if t > M:
			flg = 1
			break
	for k in range(2,N+1):
		r = p + q
		p = q
		q = r
		if flg == 1:
			break
		while (A[t] == k):
			ans = ans*r%1000000007
			t += 1
			if t == M+1:
				flg = 1
				break
		if flg == 1:
			break
	if flg2 == 0:
		print(ans%1000000007)
	else:
		print(0)
main()
import itertools
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(H):
    data.append(list(input()))

flag = False
for j in (itertools.product([0,1],repeat=int((H+W-2)/2))):
    route_flag = True
    right = 0
    down  = 0
    for k in j:
        if k == 1:
            right += 1
        else:
            down += 1
        if data[down][right] == ".":
            route_flag = False
    if route_flag:
        flag = True
    
if data[0][0] == ".":
    flag = False

if flag:
    print("Possible")
else:
    print("Impossible")

### FIXED CODE ###

import itertools
from sys import stdin
H,W = [int(x) for x in stdin.readline().rstrip().split()]
data = []
for _ in range(H):
    data.append(list(input()))

right = 0
down  = 0
for i in data:
    for j in range(0,W-1):
        if i[j] == "#" and i[j+1] == "#":
            right += 1

data_t = []
for i in range(W):
    row = []
    for vector in data:
        row.append(vector[i])
    data_t.append(row)

for i in data_t:
    for j in range(0,H-1):
        if i[j] == "#" and i[j+1] == "#":
            down += 1

if down == H-1 and right == W-1:
    print("Possible")
else:
    print("Impossible")
import itertools
from collections import defaultdict

N = int(input())
balls = sorted([tuple(map(int, input().split())) for _ in range(N)])

d = defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    d[(balls[j][0] - balls[i][0], balls[j][1] - balls[i][1])] += 1
print(N - max(d.values()))


### FIXED CODE ###

import itertools
from collections import defaultdict
from sys import exit

N = int(input())
balls = sorted([tuple(map(int, input().split())) for _ in range(N)])

if N == 1:
    print(1)
    exit()

d = defaultdict(int)
for i, j in itertools.combinations(range(N), 2):
    d[(balls[j][0] - balls[i][0], balls[j][1] - balls[i][1])] += 1
print(N - max(d.values()))
H,W = map(int,input().split()) 
if H%2 ==0:
    print(H//2*W)
else:
    if W%2 == 0:
        print((H//2+(H+1)//2)*(W//2)
    else:
        print((H//2+(H+1)//2)*(W//2)+(H+1)//2)

### FIXED CODE ###

H,W = map(int,input().split()) 
import math
if (H == 1) or (W == 1):
    print(1)
else:
    if H%2 ==0:
        print(H//2*W)
    else:
        if W%2 == 0:
            print(H*(W//2))
        else:
            print(H*((W-1)//2)+(H+1)//2)
d, g  = map(int, input().split())
if d % 2 == 1 and f % 2 == 1:
    print('Odd')
else:
    print('Even')

### FIXED CODE ###

d, g  = map(int, input().split())
if d * g  % 2 == 1:
    print('Odd')
else:
    print('Even')
N = int(input())
A = [input() for i in range(N)]
M = 10465270
T = []
N = int(input())
A = [input() for i in range(N)]
M = N * 10
T = [0 for i in range(M)]

def convert_str_to_int(s):
    if s == "A":
        return 1
    elif s == "C":
        return 2
    elif s == "G":
        return 3
    elif s == "T":
        return 4
    else:
        return 0

def get_key(value: str) -> int:
    converted_value = ""
    for s in value:
        i = convert_str_to_int(s)
        converted_value += str(i)
    return int(converted_value)

def h1(key: int) -> int:
    return key % M

def h2(key: int) -> int:
    move_value = 1 + (key % (M-1))
    return move_value

def h(key:int, i:int) -> int:
    hash_value = (h1(key) + i+h2(key)) % M
    return hash_value

def find(key: int) -> bool:
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            return True
        elif T[j] == 0 or i >= M:
            return False
        else:
            i += 1


def insert(key: int) -> None:
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 0:
            T[j] = key
            return
        else:
            i += 1


for row in A:
    order, value = row.split()
    key = get_key(value)
    if order[0] == "i":
        insert(key)
    else:
        if find(key):
            print("yes")
        else:
            print("no")
def convert_str_to_int(s):
    if s == "A":
        return 1
    elif s == "C":
        return 2
    elif s == "G":
        return 3
    elif s == "T":
        return 4
    else:
        return 0

def get_key(value: str) -> int:
    converted_value = ""
    for s in value:
        i = convert_str_to_int(s)
        converted_value += str(i)
    return int(converted_value)

def h1(key: int) -> int:
    return key % M

def h2(key: int) -> int:
    move_value = 1 + (key % (M-1))
    return move_value

def h(key:int, i:int) -> int:
    hash_value = (h1(key) + i+h2(key)) % M
    return hash_value

def find(key: int) -> bool:
    i = 0
    while True:
        j = h(key, i)
        if T[j] == key:
            return True
        elif T[j] == 0 or i >= M:
            return False
        else:
            i += 1


def insert(key: int) -> None:
    i = 0
    while True:
        j = h(key, i)
        if T[j] == 0:
            T[j] = key
            return
        else:
            i += 1


for row in A:
    order, value = row.split()
    key = get_key(value)
    if order[0] == "i":
        insert(key)
    else:
        if find(key):
            print("yes")
        else:
            print("no")


### FIXED CODE ###

N = int(input())
A = [input() for i in range(N)]

D = {}
for row in A:
    order, key = row.split()
    if order[0] == "i":
        D[key] = 1
    else:
        if key in D.keys():
            print("yes")
        else:
            print("no")
A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B =  [int(input()) for _ in range(N)]

for b in B:
  if i in range(3):
    for j in range(3):
      if A[i][j] == b:
        A[i][j] = 0

for i in range(3):
  if A[i][0] == A[i][1] == A[i][2] == 0:
    print('Yes')
    exit()

  if A[0][i] == A[1][i] == A[2][i] == 0:
    print('Yes')
    exit()
    
if A[0][0] == A[1][1] == A[2][2] == 0:
    print('Yes')
    exit()
 

if A[0][2] == A[1][1] == A[2][0] == 0:
    print('Yes')
    exit()
    
  
print('No')


### FIXED CODE ###

A = [list(map(int, input().split())) for _ in range(3)]
N = int(input())
B =  [int(input()) for _ in range(N)]

for b in B:
  for i in range(3):
    for j in range(3):
      if A[i][j] == b:
        A[i][j] = 0

for i in range(3):
  if A[i][0] == A[i][1] == A[i][2] == 0:
    print('Yes')
    exit()

  if A[0][i] == A[1][i] == A[2][i] == 0:
    print('Yes')
    exit()
    
if A[0][0] == A[1][1] == A[2][2] == 0:
    print('Yes')
    exit()
 

if A[0][2] == A[1][1] == A[2][0] == 0:
    print('Yes')
    exit()
    
  
print('No')
a,b,c=map(str,input().split())
if b=='+':
  print(int(a)+int(b))
else:
  print(int(b)-int(b))

### FIXED CODE ###

a,b,c=map(str,input().split())
if b=='+':
  print(int(a)+int(c))
else:
  print(int(a)-int(c))
def memoize(f):  
    cache = {}  
    def helper(x):  
        if x not in cache:              
            cache[x] = f(x)  
        return cache[x]  
    return helper 
        
@memoize
def fib(n):
    if n in (0, 1):
        return 1
    else:
        return fib(n - 1) + fib(n - 2)

pritn(fib(int(input())))

### FIXED CODE ###

def memoize(f):  
    cache = {}  
    def helper(x):  
        if x not in cache:              
            cache[x] = f(x)  
        return cache[x]  
    return helper 
         
@memoize
def fib(n):
    if n in (0, 1):
        return 1
    else:
        return fib(n - 1) + fib(n - 2)
 
print(fib(int(input())))
T=input()
ans=""
for i in range(len(T)):
    if T[i]=="P" or T[i]=="D":
        ans+=T[i]
    else:
        if i==0:
            if l[i+1]=="P":
                ans+="D"
            elif l[i+1]=="D":
                ans+="P"
            elif l[i+1]=="?":
                ans+="P"
        elif i!=len(T)-1:
            if ans[-1]=="P" and T[i+1]=="P":
                ans+="D"
            elif ans[-1]=="P" and T[i+1]=="D":
                ans+="D"
            elif ans[-1]=="P" and T[i+1]=="?":
                ans+="D"
            elif ans[-1]=="D" and T[i+1]=="P":
                ans+="D"
            elif ans[-1]=="D" and T[i+1]=="D":
                ans+="P"
            elif ans[-1]=="D" and T[i+1]=="?":
                ans+="P"
        else:
            if ans[-1]=="P":
                ans+="D"
            else:
                ans+="D"
print(ans)
            

### FIXED CODE ###

T=input()
ans=""
if T=="?":
    print("D")
    exit()

for i in range(len(T)):
    if T[i]=="P" or T[i]=="D":
        ans+=T[i]
    else:
        if i==0:
            if T[i+1]=="P":
                ans+="D"
            elif T[i+1]=="D":
                ans+="P"
            elif T[i+1]=="?":
                ans+="P"
        elif i!=len(T)-1:
            if ans[-1]=="P" and T[i+1]=="P":
                ans+="D"
            elif ans[-1]=="P" and T[i+1]=="D":
                ans+="D"
            elif ans[-1]=="P" and T[i+1]=="?":
                ans+="D"
            elif ans[-1]=="D" and T[i+1]=="P":
                ans+="D"
            elif ans[-1]=="D" and T[i+1]=="D":
                ans+="P"
            elif ans[-1]=="D" and T[i+1]=="?":
                ans+="P"
        else:
            if ans[-1]=="P":
                ans+="D"
            else:
                ans+="D"
print(ans)
N = int(input())
A = [int(x) for x in input().split()]
tmp = list()
for n in range(len(A)):
  tmp.append([n+1, A[n]])
tmp = sorted(tmp, key=lambda x: x[1])
res = ""
for x in tmp:
  res.append(x[0])
print(' '.join(res))

### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
tmp = list()
for n in range(len(A)):
  tmp.append([n+1, A[n]])
tmp = sorted(tmp, key=lambda x: x[1])
res = []
for x in tmp:
  res.append(x[0])
print(*res)
n, m = map(int, input().split())
sum = 0
a = np.array(list(map(int, input().split())))
for i in range(m):
    np.sort(a)
    a[0] /= 2
b = np.array([abc // 1 for abc in a])
print(sum)

### FIXED CODE ###

import heapq
n, m = map(int, input().split())
a = list(map(lambda x: int(x) * (-1), input().split()))
heapq.heapify(a)
for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))
print(-sum(a))
a,b=(int(i)+11)%13 for i in input().split()
print("Bob" if a<b else "Alice" if a>b else "Draw")

### FIXED CODE ###

a,b=[(int(i)+11)%13 for i in input().split()]
print("Bob" if a<b else "Alice" if a>b else "Draw")
n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
cnt=1
li=[]
for i in range(n-1):
    if a[i+1]==a[i]:
        cnt+=1
    else:
        cnt=1
    if cnt==2:
        li.append(a[i+1])
    if cnt==4:
        x=a[i+1]

if len(li)>=2:
    print(max(li[0]*li[1],x**2))
else:
    print(0)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
cnt=1
li=[]
x=[0]
for i in range(n-1):
    if a[i+1]==a[i]:
        cnt+=1
    else:
        cnt=1
    if cnt==2:
        li.append(a[i+1])
    if cnt==4:
        x.append(a[i+1])

if len(li)>=2:
    print(max(li[0]*li[1],max(x)**2))
else:
    print(0)
def solveZ(X, Y, Z, x, y):
	if x < len(X) and y < len(Y):
		ans = [solveZ(X, Y, Z, x, y+1)]
		for j in range(x, len(X)):
			if Y[y] == X[j]:
                                Z2 = Z + str(Y[y])
				ans.append(solveZ(X, Y, Z2, j+1, y+1))
                                break
                return max(ans)
	else:
                print(Z)
		return len(Z)

q = int(input())
ans = [[] for i in range(q)]
for i in range(q):
	X = str(raw_input())
	Y = str(raw_input())
	ans[i] = solveZ(X, Y, "", 0, 0)

for i in range(q):
	print(ans[i])

### FIXED CODE ###

def solve_L():
    X = input()
    Y = input()
  
    a = len(X)
    b = len(Y)
    c1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = X[i]
        c2 = c1+[]
        for j in range(b):
            if e1 == Y[j]:
                c1[j+1] = c2[j] + 1
            elif c1[j+1] < c1[j]:
                c1[j+1] = c1[j]
    return c1[-1]
  
n = int(input())
ans = [[] for i in range(n)]
for i in range(n):
    ans[i] = solve_L()
for i in range(n):
  print(ans[i])
n = int(input())
pf={}
for i in range(2,int(n**0.5) + 1):
    if n % i == 0:
      pf[i] = pf.get(i,0) + 1
a = max(pf)
b = int(n/a)
ans = max(len(str(a)), len(str(b)))
print(ans)

### FIXED CODE ###

n = int(input())
pf={}
for i in range(1,int(n**0.5) + 1):
    if n % i == 0:
      pf[i] = pf.get(i,0) + 1
a = max(pf)
b = int(n/a)
ans = max(len(str(a)), len(str(b)))
print(ans)
N,A,B=map(int,input().split())

cnt_blue = 0

pre_loop_cnt = N // (A+B)
totol_pre_A = sum([A] * pre_loop_cnt)
totol_pre_B = sum([B] * pre_loop_cnt)

total_tmp = totol_pre_A + totol_pre_B
total_tmp += A
if N <= total_tmp:
    cnt_blue = N -  totol_pre_B
else:
    cnt_blue = totol_pre_A + A
print(cnt_blue)

### FIXED CODE ###

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

cnt_blue = 0
total_tmp = 0

try:
    pre_cnt = N // (A+B)
    total_tmp = pre_cnt * (A+B)
    total_tmp += A
    if N <= total_tmp:
        cnt_blue = N -  (pre_cnt * B)
    else:
        cnt_blue = (pre_cnt * A) + A
    print(cnt_blue)
except Exception as e:
    print(0)
n = int(input())
if n < 600:
  ans = 8
else if n < 800:
  ans = 7
else if n < 1000:
  ans = 6
else if n < 1200:
  ans = 5
else if n < 1400:
  ans = 4
else if n < 1600:
  ans = 3
else if n < 1800:
  ans = 2
else :
  ans = 1
print(str(ans) + '-kyu')

### FIXED CODE ###

n = int(input())
if n < 600:
    ans = 8
elif  n < 800:
    ans = 7
elif n < 1000:
    ans = 6
elif n < 1200:
    ans = 5
elif  n < 1400:
    ans = 4
elif  n < 1600:
    ans = 3
elif  n < 1800:
    ans = 2
else:
    ans = 1
print(ans)
n,m=map(int,input().split())
mat=[]
dx=[0,0,-1,1]
dy=[1,-1,0,0]
for i in range(n):
    mat.append(list(input()))
f=0 
for i in range(n):
    if f:
        break 
    for j in range(m):
        if mat[i][j]=='#':
            q=[[i,j]]
            f=1 
            vis=[[0 for j in range(m)]for i in range(n)]
            vis[i][j]=1 
            while q:
                t=q.pop(0)
                #print(t)
                x,y=t[0],t[1] 
                for k in range(4): 
                    if 0<=x+dx[k]<n and 0<=y+dy[k]<m and vis[x+dx[k]][y+dy[k]]==0 and mat[x+dx[k]][y+dy[k]]=='#': 
                        vis[x+dx[k]][y+dy[k]]=1 
                        q.append([x+dx[k],y+dy[k]])
            break 
for i in range(n):
    for j in range(m): 
        if vis[i][j]==0 and mat[i][j]=='#':
           # print(i,j)
            print('No')
            exit()
print('Yes')

### FIXED CODE ###

n,m=map(int,input().split())
mat=[]
dx=[0,0,-1,1]
dy=[1,-1,0,0]
for i in range(n):
    mat.append(list(input().strip()))
f=0 
for i in range(n):
    for j in range(m):
        if mat[i][j]=='#':
            f=0 
            for k in range(4): 
                if 0<=i+dx[k]<n and 0<=j+dy[k]<m and mat[i+dx[k]][j+dy[k]]=='#': 
                    f=1  
            if not f:
                print('No')
                exit()
print('Yes')
a,b=input().float()
c,d=map(int,input().float())
e=imput()
if e==a:
  c=c-1
else:
  d=d-1
print(c,d)


### FIXED CODE ###

a,b=input().split()
c,d=map(int,input().split())
e=input()
if e==a:
  c=c-1
else:
  d=d-1
print(c,d)
n = int(input())
s = str(inout())
print(s.count('ABC'))

### FIXED CODE ###

n = int(input())
s = str(input())
print(s.count('ABC'))
X,Y=map(int,input().split())
var=0
for i in range(2X,4X+1,2):
  if Y==i:
    var=1
if var==1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

A = list(map(int,input().split()))
ans=0
for i in range(5):
  if A[i]!=i+1:
    ans=i+1
print(ans)
a,b=map(int,input()/split())
if a>=b+2:
  print(2*a-1)
elif b>=a+2:
  print(2*b-1)
else:
  print(a+b)

### FIXED CODE ###

a,b=map(int,input().split())
if a>=b+2:
  print(2*a-1)
elif b>=a+2:
  print(2*b-1)
else:
  print(a+b)
N, M = map(int, input().split())
if N == 0:
    print(0)
elif N >= M:
    print(M // 2)
else:
    ret = N
    M -= N * 2
    ret += M // 4
    print(ret)

### FIXED CODE ###

N = int(input())
print(N * 800 - N // 15 * 200)
input_line = input()

num_array = input_line.split()
ans = num_array[0] * num_array[1] %2

if ans = "0":
  print("Even")
else:
  print("Odd")

### FIXED CODE ###

a,b = input().split()

c = int(a)*int(b)%2

if c==1:
    print("Odd")
else:
    print("Even")
class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n)
        
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
        
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if(x == y):
            return
        
        if(self.parents[x] > self.parents[y]):
            x, y = y, x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def size(self, x):
        return -self.parents[self.find(x)]
    
    def same(self, x, y):
        return self.find(x) == self.find(y)
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    
    def group_count(self):
        return len(self.roots())
    
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
    
    def __str__(self):
        return '\n'.join('{}:{}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int,input().split())
uf = Unionfind(n)


for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

print(uf.group_count()-1)

### FIXED CODE ###

class Unionfind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * (n)
        
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
        
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        
        if(x == y):
            return
        
        if(self.parents[x] > self.parents[y]):
            x, y = y, x
            
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    
    def group_count(self):
        return len(self.roots())

n, m = map(int,input().split())
uf = Unionfind(n)


for _ in range(m):
    a, b = map(int, input().split())
    uf.union(a-1, b-1)

print(uf.group_count()-1)