Harryxun/stf_run huggingface dataset:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    a = [LI() for _ in range(H)]

    ans = []
    # 奇数枚の山のコインを右の山に移動
    if W >= 2:
        for i in range(H):
            for j in range(W - 1):
                if a[i][j] % 2 == 1:
                    a[i][j] -= 1
                    a[i][j+1] += 1
                    ans.append((i + 1, j + 1, i + 1, j + 2))

    # 一番右の列の奇数枚の山のコインを下の山に移動
    if H >= 2:
        for i in range(H - 1):
            if a[i][-1] % 2 == 1:
                a[i][-1] -= 1
                a[i+1][-1] += 1
                ans.append((i + 1, j + 1, i + 2, j + 1))

    for i in a:
        print(*i)

    print(len(ans))
    for i in ans:
        print(*i)

if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    a = [LI() for _ in range(H)]

    ans = []
    # 奇数枚の山のコインを右の山に移動
    if W >= 2:
        for i in range(H):
            for j in range(W - 1):
                if a[i][j] % 2 == 1:
                    a[i][j] -= 1
                    a[i][j+1] += 1
                    ans.append((i + 1, j + 1, i + 1, j + 2))

    # 一番右の列の奇数枚の山のコインを下の山に移動
    if H >= 2:
        for i in range(H - 1):
            if a[i][-1] % 2 == 1:
                a[i][-1] -= 1
                a[i+1][-1] += 1
                ans.append((i + 1, W, i + 2, W))

    # for i in a:
    #     print(*i)

    print(len(ans))
    if ans:
        for i in ans:
            print(*i)

if __name__ == '__main__':
    resolve()
import sys
from itertools import permutations

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    assert N <= 8

    X = [int(i) for i in input().split()]

    for i in range(N - 1):
        if X[i] + 1 == X[i + 1] and X[i] > 1 and X[i-1] < X[i] - 1:
            X[i] -= 1
    cnt = 0
    MOD = 10**9 + 7
    i = 0

    for pm in permutations(range(N)):
        Xc = X[:]
        flag = True

        for p in pm:
            for i in range(p-1, 0, -1):
                if Xc[i] == Xc[i - 1] + 1 and Xc[i - 1] == 1:
                    flag = False
                    break
            if flag:
                break
            Xc[p] = -(1 + 2*i)
            i += 1

        cnt += flag

        # if flag:
            # print(list(pm))

    print(cnt % MOD)


if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys
from math import factorial

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    X = [int(i) for i in input().split()]
    MOD = 10**9 + 7
    ans = 1
    stack = 0

    for x in X:
        stack += 1
        if x < 2*(stack - 1) + 1:
            ans *= stack
            ans %= MOD
            stack -= 1

    ans *= (factorial(stack) % MOD)
    ans %= MOD

    print(ans)


if __name__ == '__main__':
    solve()
K = int(input())
A, B = map(int, input().split())

if ((A // K != B // K) || A % K == 0 || B % K == 0):
	print('OK')
else:
	print('NG')


### FIXED CODE ###

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

if ((A // K != B // K) or A % K == 0 or B % K == 0):
	print('OK')
else:
	print('NG')
x = raw_input()
print(x[0][0]+x[1][1]+x[2][2])

### FIXED CODE ###

x = input()
y = input()
z = input()
print(x[0]+y[1]+z[2])
import numpy as np

n, w = map(int, input().strip().split())
data = [list(map(int, input().strip().split())) for _ in range(n)]

# i番目に重さがj以下となるように選んだときの価値の総和の最大値
dp = np.zeros((n, w + 1), dtype=np.int64)

for i in range(0, n):
    for j in range(w + 1):
        # i 番目の品物の重さと価値
        wi, vi = data[i]
        if i == 0:
            take = vi if j - wi >= 0 else 0
            miss = 0
            dp[i][j] = max(take, miss)
        else:
            # i番目の品物を入れる場合
            take = dp[i - 1][j - wi] + vi if j - wi >= 0 else 0
            # 入れない場合
            miss = dp[i - 1][j]
            dp[i][j] = max(take, miss)

print(np.max(dp[n - 1]))


### FIXED CODE ###

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

# 足場 i にたどり着くまでのコストの総和の最小値
dp = [1e14] * n

dp[0] = 0
dp[1] = abs(hs[0] - hs[1])

for i in range(2, n):
    dp[i] = min(abs(hs[i] - hs[i - 1]) + dp[i - 1], abs(hs[i] - hs[i - 2]) + dp[i - 2])

print(dp[n - 1])
N,K = map(int,input().split())

lis = []
count = 0

for _ in range(int(input())):
  lis.append(input())
  
for height in lis:
  if height >= K:
    count += 1
    
print(count)
  

### FIXED CODE ###

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

lis = []
count = 0

lis = list(map(int,input().split()))
  
for height in lis:
  if height >= K:
    count += 1
    
print(count)
while True:
    m,n = map(int,input().split())
    sw = []
    bw = []
    if m == 0 and n == 0:
        break
    for i in range(2*n-1):
        if i % 2 == 0:
            sw.append(list(map(int,input().split())))
        else:
            bw.append(list(map(int,input().split())))
    flag = [[0 for i in range(m)] for j in range(n)]
    l = [(0,0,1)]
    res = 0
    while l:
        bf = l.pop(0)
        x,y,z = bf[0],bf[1],bf[2]
        if x == n-1 and y == m-1:
            res = z
            break
        flag[x][y] += 1
        if 1 <= x and bw[x-1][y] == 0 and flag[x-1][y] == 0:
            l.append((x-1,y,z+1))
        if y < m-1 and sw[x][y] == 0 and flag[x][y+1] == 0:
            l.append((x,y+1,z+1))
        if 1 <= y and sw[x][y-1] == 0 and flag[x][y-1] == 0:
            l.append((x,y-1,z+1))
        if x < n-1 and bw[x][y] == 0 and flag[x+1][y] == 0:
            l.append((x+1,y,z+1))
    print(res)

### FIXED CODE ###

while True:
    m,n = map(int,input().split())
    sw = []
    bw = []
    if m == 0 and n == 0:
        break
    for i in range(2*n-1):
        if i % 2 == 0:
            sw.append(list(map(int,input().split())))
        else:
            bw.append(list(map(int,input().split())))
    flag = [[0 for i in range(m)] for j in range(n)]
    l = [(0,0,1)]
    res = 0
    while l:
        bf = l.pop(0)
        if bf[0] == n-1 and bf[1] == m-1:
            res = bf[2]
            break
        flag[bf[0]][bf[1]] = 1
        if 1 <= bf[0] and bw[bf[0]-1][bf[1]] == 0 and flag[bf[0]-1][bf[1]] == 0:
            flag[bf[0]-1][bf[1]] = 1
            l.append((bf[0]-1,bf[1],bf[2]+1))
        if bf[1] < m-1 and sw[bf[0]][bf[1]] == 0 and flag[bf[0]][bf[1]+1] == 0:
            flag[bf[0]][bf[1]+1] = 1
            l.append((bf[0],bf[1]+1,bf[2]+1))
        if 1 <= bf[1] and sw[bf[0]][bf[1]-1] == 0 and flag[bf[0]][bf[1]-1] == 0:
            flag[bf[0]][bf[1]-1] = 1
            l.append((bf[0],bf[1]-1,bf[2]+1))
        if bf[0] < n-1 and bw[bf[0]][bf[1]] == 0 and flag[bf[0]+1][bf[1]] == 0:
            flag[bf[0]+1][bf[1]] = 1
            l.append((bf[0]+1,bf[1],bf[2]+1))
    print(res)
import re
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix

N, M = [int(i) for i in re.split(" ", input())]
G = lil_matrix((N, N), dtype=np.bool)

for i in range(M):
    u, v = [int(i) for i in re.split(" ", input())]
    G[u-1, v-1] = True
G = G.tocsr()
G = G.dot(G).dot(G)

S, T = [int(i) for i in re.split(" ", input())]

count = -1
G_tmp = G
for i in range(1, N+1):
    if i == 1:
        pass
    else:
        G_tmp = G_tmp.dot(G)
    if G_tmp[S-1, T-1]:
        count = i
        break

print(count)

### FIXED CODE ###

import numpy as np
S = input()
S_ = list(set(S))
S = np.array(list(S))
S_ = np.array(S_)
ans = 'Yes'
if len(S_)!=2:
    ans = 'No'
elif sum(S==S_[0])!=2:
    ans = 'No'

print(ans)
n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  if a[x]==x:
    return x
  a[x] = find(a[x])
  return a[x]

def union(x,y):
  x, y = find(x), find(y)
  if x == y: return
  a[x] = y

for _ in range(m):
  x,y=map(lambda x:int(x)-1,input().split())
  union(x, y)

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))


### FIXED CODE ###

n,m=map(int,input().split())
# Union-Find
a=list(range(n))
def find(x):
  g = x
  while g != a[g]: g = a[g]
  a[x] = g
  return g

for _ in range(m):
  x,y=map(int,input().split())
  x,y=find(x-1),find(y-1)
  if x == y: continue
  a[y]=x

count=[0]*n
for i in range(n):
  count[find(i)] += 1
print(max(count))
import numpy as np

def iterate(mapdata, passed, curr, count):
    if curr == (passed.shape[0] - 1, passed.shape[1] - 1):
        return count

    if mapdata[curr[0]][curr[1]] == '#':
        return passed[curr]
    
    passed[curr] = min(passed[curr], count)
    if passed[curr] < count:
        return 100000
    
    ret = 100000
    if curr[0] > 0:
        tmp = iterate(mapdata, passed, (curr[0] - 1, curr[1]), count + 1)
        ret = min(ret, tmp)
    if curr[1] > 0:
        tmp = iterate(mapdata, passed, (curr[0], curr[1] - 1), count + 1)
        ret = min(ret, tmp)
    if curr[0] < passed.shape[0] - 1:
        tmp = iterate(mapdata, passed, (curr[0] + 1, curr[1]), count + 1)
        ret = min(ret, tmp)
    if curr[1] < passed.shape[1] - 1:
        tmp = iterate(mapdata, passed, (curr[0], curr[1] + 1), count + 1)
        ret = min(ret, tmp)

    return ret


h, w = map(int, input().split())
mapdata = [input() for y in range(h)]
dotsum = sum(mapdata[y].count('.') for y in range(h))

passed = np.zeros((h, w), np.int32)
passed[:, :] = 100000
count = iterate(mapdata, passed, (0, 0), 0)
#print(count)
print(dotsum - count - 1)


### FIXED CODE ###

import numpy as np

def iterate2(mapdata, passed, start):
    queue = [(start, 0)]

    while len(queue) > 0:
        curr, count = queue[0]
        del queue[0]
        if curr == (passed.shape[0] - 1, passed.shape[1] - 1):
            return count
        if mapdata[curr[0]][curr[1]] == '#':
            continue
        if passed[curr] > 0:
            continue
        passed[curr] = 1

        if curr[0] < passed.shape[0] - 1:
            queue.append(((curr[0] + 1, curr[1]), count + 1))
        if curr[1] < passed.shape[1] - 1:
            queue.append(((curr[0], curr[1] + 1), count + 1))
        if curr[0] > 0:
            queue.append(((curr[0] - 1, curr[1]), count + 1))
        if curr[1] > 0:
            queue.append(((curr[0], curr[1] - 1), count + 1))
    
    return -1

h, w = map(int, input().split())
mapdata = [input() for y in range(h)]
dotsum = sum(mapdata[y].count('.') for y in range(h))

passed = np.zeros((h, w), np.int8)
count = iterate2(mapdata, passed, (0, 0))
#print(dotsum)
#print(count)
if count > 0:
    print(dotsum - count - 1)
else:
    print(-1)
input_nums = [int(n) for n in input().slice(“ ”)]
h = input_nums[0]
w = input_nums[1]

count = 0

for i in range(h):
	for c in input():
		if c == “#”:
			count += 1

if count == h+w-1:
	print(“Possible”)
else:
	print(“Impossible”)

### FIXED CODE ###

input_nums = [int(c) for c in input().split(" ")]
h = input_nums[0]
w = input_nums[1]

count = 0

for i in range(h):
	for c in input():
		if c == "#":
			count += 1

if count == h+w-1:
	print("Possible")
else:
	print("Impossible")
import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

tmp = -10
li = [a,b,c,d,e]
for i in li:
  tmp += math.ceil(i/10)*10
li_1 = [a%10,b%10,c%10,d%10,e%10]
for i in range(5):
  try:
    li_1.remove(0)
  except:
    break
print(int(tmp + min(li_1)))

### FIXED CODE ###

import math

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

tmp = -10
li = [a,b,c,d,e]
for i in li:
  tmp += math.ceil(i/10)*10
if a%10 + b%10 + c%10 + d%10 + e%10 == 0:
  print(int(tmp +10))
else:
  li_1 = [a%10,b%10,c%10,d%10,e%10]
  for i in range(5):
    try:
      li_1.remove(0)
    except:
      break
  print(int(tmp + min(li_1)))
A, = [s.split() for s in open(0)]
A = A[0]
acgt = []
for i in range(len(A)):
    for j in range(len(A), 0, -1):
        sub_string = A[i:j]
        for s in sub_string:
            if s not in ["A", "C", "G", "T"]:
                break 
        else:
            acgt.append(sub_string)
print(max([len(s) for s in acgt]))

### FIXED CODE ###

A, = [s.split() for s in open(0)]
if len(A) == 0:
    A = [""]
else:
    A = A[0]
acgt = []
for i in range(len(A)):
    for j in range(len(A), 0, -1):
        sub_string = A[i:j]
        for s in sub_string:
            if s not in ["A", "C", "G", "T"]:
                break 
        else:
            acgt.append(sub_string)
if len(acgt) == 0:
    print(0)
else:
    print(max([len(s) for s in acgt]))
from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]
if A<1 or A>9 B<1 or B>9:
    ans = -1
else:
    ans = A*B

print(ans)


### FIXED CODE ###


from sys import stdin

A, B = [int(x) for x in stdin.readline().rstrip().split()]
if A<1 or A>9 or B<1 or B>9:
    ans = -1
else:
    ans = A*B

print(ans)
2**log2(int(input().split()[0]))-1



### FIXED CODE ###

import math

h = int(input())
atk = 0
for i in range(int(math.log2(h)) + 1):
    atk += 2 ** i

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

divisors = []
for i in range(1, min(A,B) + 1):
	if A % i == 0 and B % i == 0:
		divisors.append(i)

def is_coprime(a,b):
	for i in range(2, min(A,B)):
		if a % i == 0 and b % i == 0:
			return False
	return True

def getMaxLen(sofar, divisors):
	if len(divisors) == 0:
		return len(sofar)
	curr_max = getMaxLen(sofar,divisors[1:])
	for i in range(len(divisors)):
		d = divisors[i]
		flag = False
		for s in sofar:
			if not is_coprime(d,s):
				flag = True
				break
		if flag:
			continue
		new = sofar.copy()
		
		new.append(d)
		curr_max = max(curr_max, getMaxLen(new, divisors[i+1:]))
	return curr_max

print(getMaxLen([], divisors))


### FIXED CODE ###

n = int(input())
if n % 2 == 0:
	print(0.5)
else:
	print((1 + n//2) / n)
l = input().split(" ")
N = int(l[0])
M = int(l[1])

answered = set()

ac_count = 0
wa_count = 0

for n in range(M):
    result = [i for i in input().split(" ")]
    p = result[0]
    if p in answered:
        continue
    s = result[1]
    if s == "WA":
        wa_count += 1
    else:
        ac_count += 1
        answered.add(p)
        if len(answered) == N:
            break

print(ac_count, wa_count)

### FIXED CODE ###

ord_s = ord(input())

chr_s = chr(ord_s+1)
print(chr_s)
#!/usr/bin/env python3
import sys
import re

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S)%2!=0:
        print("No")
    l=S[::2];count=0;p=S[1::2]
    for i in range(len(l)):
        if l[i]=="h":
            count+=1
        if p[i]=="i":
            count+=1
    if count==len(S):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import re

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S)%2!=0:
        print("No")
        exit()
    l=S[::2];count=0;p=S[1::2]
    #if len(l)
    for i in range(len(l)):
        if l[i]=="h":
            count+=1
        if p[i]=="i":
            count+=1
    if count==len(S):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(100)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a-b==X:
                print(i,j)
                exit()
            elif a+b==X:
                print(i,-j)
                exit()
    raise Exception
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    l=[i**5 for i in range(2000)]
    for i,a in enumerate(l):
        for j,b in enumerate(l):
            if a-b==X:
                print(i,j)
                exit()
            elif a+b==X:
                print(i,-j)
                exit()
    raise Exception
    

if __name__ == '__main__':
    main()
def main():
    input = stdin.buffer.readline
    n, k = map(int, input().split())
    r, s, p = map(int, input().split())
    t = input()[:-1].decode()

    ans = 0
    result = [False] * n
    for i in range(n):
        if k <= i and t[i] == t[i - k] and result[i - k]:
            continue
        if t[i] == 'r':
            ans += p
        elif t[i] == 's':
            ans += r
        elif t[i] == 'p':
            ans += s
        result[i] = True

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()


### FIXED CODE ###

from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n, k = map(int, input().split())
    r, s, p = map(int, input().split())
    t = input()[:-1].decode()

    ans = 0
    result = [False] * n
    for i in range(n):
        if k <= i and t[i] == t[i - k] and result[i - k]:
            continue
        if t[i] == 'r':
            ans += p
        elif t[i] == 's':
            ans += r
        elif t[i] == 'p':
            ans += s
        result[i] = True

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
_fib = [None] * 44
_fib[0] = 1
_fib[1] = 1

def fib(n):
    if _fib[n] is None:
        _fib[n] = fib(n-1) + fib(n-2)
    return _fib[n]

_n = int(raw_input())
print(fib(_n))

### FIXED CODE ###

_fib = [None] * 45
_fib[0] = 1
_fib[1] = 1

def fib(n):
    if _fib[n] is None:
        _fib[n] = fib(n-1) + fib(n-2)
    return _fib[n]

_n = int(raw_input())
print(fib(_n))
s=input()
s[3]="8"
print(s)

### FIXED CODE ###

s=input()
print(s[:3]+"8"+s[4:])
a=list(map(int,input().split()))
b=int(input())
a.sort()
print(a[0]+a[1]+(a[2]*(2**b))

### FIXED CODE ###

a=list(map(int,input().split()))
b=int(input())
a.sort()
print(a[0]+a[1]+(a[2]*(2**b)))
import numpy as np
from pprint import pprint


def solve(MM, H, W):

    L, R, U, D = np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int), np.zeros((H, W), dtype=int)

    for i in range(H):
        i_r = H - 1 - i

        # L, U
        for j in range(W):
            j_r = W - 1 - j

            # L
            if MM[i][j]:
                if j == 0:
                    L[i][j] = 1
                else:
                    L[i][j] = L[i][j - 1] + 1

            # R
            if MM[i][j_r]:
                if j_r == W - 1:
                    R[i][j_r] = 1
                else:
                    R[i][j_r] = R[i][j_r + 1] + 1

            # U
            if MM[i][j]:
                if i == 0:
                    U[i][j] = 1
                else:
                    U[i][j] = U[i - 1][j] + 1

            # D
            if MM[i_r][j]:
                if i_r == H - 1:
                    D[i_r][j] = 1
                else:
                    D[i_r][j] = D[i_r + 1][j] + 1

    print((L + R + U + D - 3).max())


def solve2(MM, H, W):
    L, R, U, D = [MM.copy() for _ in range(4)]

    # U, D
    for i in range(1, H):
        U[i] = (U[i - 1] + 1) * MM[i]
        i_r = H - 1 - i
        D[i_r] = (D[i_r + 1] + 1) * MM[i_r]

    MM_T = MM.T
    L_T, R_T = L.T, R.T

    # L, R
    for i in range(1, W):
        L_T[i] = (L_T[i - 1] + 1) * MM_T[i]
        i_r = W - 1 - i
        R_T[i_r] = (R_T[i_r + 1] + 1) * MM_T[i_r]

    L, R = L_T.T, R_T.T
    print((L + R + U + D).max() - 3)


def stdin():
    H, W = [int(x) for x in input().split()]
    MM = np.zeros((H, W), dtype=int)

    for i in range(H):
        line = str(input())

        for j in range(W):
            if line[j] != '#':
                MM[i][j] = 1

    solve2(MM, H, W)


if __name__ == '__main__':
    stdin()


### FIXED CODE ###

def solve():
    p, q, r = sorted([int(x) for x in input().split()])

    print(p + q)


if __name__ == '__main__':
    solve()
# 整数の入力
N = int(input())
r = 2
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(10**(N-2) * combinations_count(n, r) / (10**9 + 7))

### FIXED CODE ###

# 整数の入力
N = int(input())
 
print((10 ** N - 2* 9 ** N + 8 ** N) % (10 ** 9 + 7))
a,b,c=map(int,input());print(a*b/2)

### FIXED CODE ###

a,b,c=map(int,input().split());print(a*b//2)
n,k = [ int(i) for i in input().split(" ") ]
s = input()
print(s[:k] + s[k].lower() + s[k+1:])

### FIXED CODE ###

n,k = [ int(i) for i in input().split(" ") ]
s = input()
print(s[:k-1] + s[k-1].lower() + s[k:])
N = input()

data = [list(raw_input()) for i in range(N)]

alpha = [chr(i) for i in range(97,97+26)]
cnt = [[0 for i in range(26)] for i in range(N)]

for i in range(N):
    for j in range(26):
        cnt[i][j] = data[i].count(alpha[j])


ans = ''
for i in range(26):
    mini = 10000
    for j in range(n):
        mini = min(mini,cnt[j][i]) 
    ans += alpha[i]*mini

print ans

### FIXED CODE ###

N = input()

data = [list(raw_input()) for i in range(N)]

alpha = [chr(i) for i in range(97,97+26)]
cnt = [[0 for i in range(26)] for i in range(N)]

for i in range(N):
    for j in range(26):
        cnt[i][j] = data[i].count(alpha[j])


ans = ''
for i in range(26):
    mini = 10000
    for j in range(N):
        mini = min(mini,cnt[j][i]) 
    ans += alpha[i]*mini

print ans
x = input()
print(a*x*x)

### FIXED CODE ###

x = int(input())
print(3*x*x)
S = input()
if S == "SAT":
    print(1)
elif S == "FRI":
    print(2)
elif S == "THU":
    print(3)
elif S =="WED":
    print(4)
elif S == "TUE":
    print(5)
elif S == "MON":
    print(6)
elif S = "SUN":
    print(7)        

### FIXED CODE ###

S = input()
if S == "SAT":
    print(1)
elif S == "FRI":
    print(2)
elif S == "THU":
    print(3)
elif S =="WED":
    print(4)
elif S == "TUE":
    print(5)
elif S == "MON":
    print(6)
elif S == "SUN":
    print(7)
n = int(input())
a = list(map(int, input().split())).sort()
b = list(map(int, input().split())).sort()
flag = True
for i in range(n):
  if a[i] > b[i]:
    flag = False
    break
if flag:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import numpy as np

n = int(input())
a = np.array(input().split(), dtype=np.int)
b = np.array(input().split(), dtype=np.int)
arg = np.argsort(b)
a = a[arg]
b = b[arg]
arg = np.argsort(a)
if np.all(a[arg] <= b):
  i = arg[0]
  cycle_size = 1
  while i != 0:
    i = arg[i]
    cycle_size += 1
  if cycle_size == n and np.all(a[arg[1:]] > b[:-1]):
    print('No')
  else:
    print('Yes')
else:
  print('No')