Harryxun/stf_run huggingface dataset:
import itertools

A,B,C,D,E,F = map(int,input().split())

WF = F//100+1

water = [False] * (WF+1+30)
sugar = [False] * (F+1+30)

water[0] = True
sugar[0] = True

for n in range(WF):
  if water[n]:
    water[n+A] = True
    water[n+B] = True
for n in range(F):
  if sugar[n]:
    sugar[n+C] = True
    sugar[n+D] = True

water = set(100*x for x in range(1,1+WF) if water[x])
sugar = set(x for x in range(1,1+F) if sugar[x])

# at most 30 * 3000なので全てやる
ans_per = -1
for w, s in itertools.product(water, sugar):
  if w//100*E < s:
    continue
  if w+s > F:
    continue
  x = s/(w+s)
  if x > ans_per:
    ans_per = x
    ans_w = w
    ans_s = s

print(ans_w + ans_s, ans_s)

### FIXED CODE ###

import itertools

A,B,C,D,E,F = map(int,input().split())

WF = F//100+1

water = [False] * (WF+1+30)
sugar = [False] * (F+1+30)

water[0] = True
sugar[0] = True

for n in range(WF):
  if water[n]:
    water[n+A] = True
    water[n+B] = True
for n in range(F):
  if sugar[n]:
    sugar[n+C] = True
    sugar[n+D] = True

water = set(100*x for x in range(1,1+WF) if water[x])
sugar = set(x for x in range(1+F) if sugar[x])

# at most 30 * 3000なので全てやる
ans_per = -1
for w, s in itertools.product(water, sugar):
  if w//100*E < s:
    continue
  if w+s > F:
    continue
  x = s/(w+s)
  if x > ans_per:
    ans_per = x
    ans_w = w
    ans_s = s

print(ans_w + ans_s, ans_s)
def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    a, b = input()
    if a == 1:
        a = 14
    if b == 1:
        b = 14

    if a == b:
        print('Draw')
    elif a > b:
        print('Alice')
    else:
        print('Bob')
 
main()


### FIXED CODE ###

def read():
    return int(input())

def reads(sep=None):
    return list(map(int, input().split(sep)))

def main():
    a, b = reads()
    if a == 1:
        a = 14
    if b == 1:
        b = 14

    if a == b:
        print('Draw')
    elif a > b:
        print('Alice')
    else:
        print('Bob')
 
main()
import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)
# print(round(102,-1))

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(10-m)
min_ = max(mod_list)
# print(mod_list)



print(sum(time_list2)-min_)

### FIXED CODE ###

import math
time_list=[]

for _ in range(5):
    time_list.append(int(input()))
# print(1, time_list)

time_list2=[]
for x in time_list:
    m = x % 10
    if m!=0:
        time_list2.append(x+(10-m))
    else:
        time_list2.append(x)
# print("2", time_list2)

mod_list = []
for x in time_list:
    m = x % 10
    if m!=0:
        mod_list.append(m)
    else:
        mod_list.append(10)
min_ = min(mod_list)
# print(mod_list)



print(sum(time_list2)-(10-min_))
n = int(input())
S = input()
s = list(S)
j = list(S)
ans = 0
aans = 0
for i in range(n-2,-1,-1):
    if s[i] == "#" and s[i+1] == ".":
        ans += 1
        s[i+1] = "#"
for i in range(n-1):
    if j[i] == "#" and j[i+1] == ".":
        aans += 1
        j[i+1] == "#"
print(min(ans,aans))


### FIXED CODE ###

a,b,c = map(int,input().split())
if a < c < b:
        ans = "Yes"
elif b < c < a:
        ans = "Yes"
else:
        ans = "No"
print(ans)
N = int(input())
C = 'ACL'
print(ACL*N)

### FIXED CODE ###

N = int(input())
C = 'ACL'
print(C*N)
from sys import stdin

n = int(stdin.readline().rstrip())
flowers = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 0


def watering(s, count):
    index_fwd = 10 ** 9
    index_back = 0
    for k in range(len(s)):
        if s[k] > 0:
            index_fwd = k
            break
    for l in range(index_fwd, len(s)):
        if s[l] == 0:
            break
        index_back = l
    if index_fwd == 10 ** 9:
        return count
    for m in range(index_fwd, index_back + 1):
        s[m] -= 1
    count += 1
    return watering(s, count)


print(watering(flowers, 0))

### FIXED CODE ###

from sys import stdin
import sys
sys.setrecursionlimit(10000)

n = int(stdin.readline().rstrip())
flowers = [int(x) for x in stdin.readline().rstrip().split()]


def watering(s, count):
    index_fwd = 10 ** 9
    index_back = 0
    for k in range(len(s)):
        if s[k] > 0:
            index_fwd = k
            break
    if index_fwd == 10 ** 9:
        return count
    for l in range(index_fwd, len(s)):
        if s[l] == 0:
            break
        index_back = l
    for m in range(index_fwd, index_back + 1):
        s[m] -= 1
    count += 1
    return watering(s, count)


print(watering(flowers, 0))
a, b, k = input().split()
a = int(a)
b = int(b)
k = int(k)

first_a = a
a -= k if k < a else a
k -= first_a if a == 0 else 0
b -= k

print(a + " " + b)

### FIXED CODE ###

a, b, k = input().split()
a = int(a)
b = int(b)
k = int(k)

first_a = a
a -= k if k < a else a
k -= first_a if a == 0 else 0
b -= 0 if a != 0 else k
b = 0 if b < 0 else b

print(a, end=" ")
print(b)
N = int(input())
S = input()
string = list(S)

alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
            'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
            'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

#Generate empty output
output = ''

for i in range(len(S)):
    #Get the index of an alphabet in the list
    ind1 = alphabet.index(string[i])
    #Divide N by 26 and get the remainder
    ind2 = (int(ind1) + N) % 26
    #Update the letter and keep adding it to the list
    output += alphabet[ind2]

print(output)

### FIXED CODE ###

date = input()

List = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']

for i in range(len(List)):
    if List[i] == date:
        print(i+1)
print(int(input(n**3)))

### FIXED CODE ###

print(int(input())**3)
# C - Snack
from math import gcd
A, B = map(int, input().split())
print(int(A * B / gcd(A, B)))

### FIXED CODE ###

from fractions import *
a, b=map(int, input().split())
print(a * b // gcd(a, b))
import sys
sys.setrecursionlimit(10**6)
def solve(v):
    t=[]
    for u in e[v]:
        if not f[u]:
            f[u]=1
            t=solve(u)+t
            break
    return [v]+t
n,m,*t=map(int,open(0).read().split())
e=[[]for _ in range(n+1)]
for a,b in zip(t[::2],t[1::2]):
    e[a].append(b)
    e[b].append(a)
f=[0]*-~n
f[1]=1
a=solve(1)[:0:-1]+solve(1)
print(len(a),*a)

### FIXED CODE ###

n,m,*t=map(int,open(0).read().split())
e=[[]for _ in range(n+1)]
for a,b in zip(t[::2],t[1::2]):
    e[a].append(b)
    e[b].append(a)
f=[0]*-~n
f[1]=1
a=[1]
while 1:
    for v in e[a[-1]]:
        if not f[v]:
            f[v]=1
            a.append(v)
            break
    else:
        break
b=[1]
while 1:
    for v in e[b[-1]]:
        if not f[v]:
            f[v]=1
            b.append(v)
            break
    else:
        break
a=a[:0:-1]+b
print(len(a),*a)
a, b = map(int, input().split())

c = 1
for i in range(20):
    if b > c:
        c += a-1
    else:
        break
print(-(-(c -1)// a-1)

### FIXED CODE ###

a, b = map(int, input().split())
print(-(-(b-1) // (a-1)))
import sys
input = sys.stdin.readline
s = input.split()
nums = []
[[nums.append(num) for num in row] for row in s[:3]]
n = int(s[3])
bs = s[4:]
mat = [num in bs for num in nums]
pattterns = [[1, 2, 3],
                [1, 5, 9],
                [1, 4, 7],
                [2, 5, 8],
                [3, 5, 7],
                [3, 6, 9],
                [4, 5, 6],
                [7, 8, 9]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")

### FIXED CODE ###

import sys
input = sys.stdin.readlines()
nums = []
[[nums.append(num) for num in row.strip().split(" ")] for row in input[:3]]
bs = [i.strip() for i in input[4:]]
mat = [num in bs for num in nums]
patterns = [[0, 1, 2],
            [0, 4, 8],
            [0, 3, 6],
            [1, 4, 7],
            [2, 4, 6],
            [2, 5, 8],
            [3, 4, 5],
            [6, 7, 8]]
for pat in patterns:
    if mat[pat[0]] and mat[pat[1]] and mat[pat[2]]:
        print("Yes")
        sys.exit()
print("No")
def f():
	S = input()
    for idx, s in enumerate(S):
      if s == 'A':
        a = 1
      if s == 'B':
        b = 1
      if a == 1 and b == 1:
        break
    return 'Yes' if a == 1 and b == 1 else 'No'
    
      
  
print(f())

### FIXED CODE ###

def f():
    S = raw_input()
    return 'Yes' if len(set(S)) == 2 else 'No'

print(f())
a,b = int()
num = a*b
if num % 2 ==0:
    print("Even")
else:
     print("Odd")    

### FIXED CODE ###

a,b=map(int,input().split())
if(a*b % 2 == 0):
  print('Even')
else:
  print('Odd')
# D - Prediction and Restriction 
N,K = map(int,input().split())
RSP = tuple(map(int,input().split()))
T = input()

# じゃんけんの勝敗を返す関数
def judge(a,b):
    if a == 'r' and b == 2:
        return True
    elif a == 's' and b == 0:
        return True
    elif a == 'p' and b == 1:
        return True
    return False

# dp[i][j]: i 回目のじゃんけんで j を出したときの最大値
# グー:0, チョキ:1, パー:2
dp = [[0]*3 for _ in range(N+1)]

# v 回目のじゃんけん
for v in range(1,N+1):
    # v 回目に出した手
    for w in range(3):
        # v-K 回目に出した手 
        for k in range(3):
            if w == k:
                continue
            # じゃんけんで勝ったとき
            if judge(T[v-1],w):
                dp[v][w] = max(dp[v][w],dp[v-K][k] + RSP[w])
            # じゃんけんで負けか引き分けたとき
            else;
                dp[v][w] = max(dp[v][w],dp[v-K][k])    
# K 個に分けた各グループの部分和の最大値の総和を求める
ans = 0
for a in range(1,K+1):
    ans += max(dp[-a])
print(ans)

### FIXED CODE ###

# D - Prediction and Restriction 
N,K = map(int,input().split())
RSP = tuple(map(int,input().split()))
T = input()

# じゃんけんの勝敗を返す関数
def judge(a,b):
    if a == 'r' and b == 2:
        return True
    elif a == 's' and b == 0:
        return True
    elif a == 'p' and b == 1:
        return True
    return False

# dp[i][j]: i 回目のじゃんけんで j を出したときの最大値
# グー:0, チョキ:1, パー:2
dp = [[0]*3 for _ in range(N+1)]

# v 回目のじゃんけん
for v in range(1,N+1):
    # v 回目に出した手
    for w in range(3):
        # v-K 回目に出した手 
        for k in range(3):
            if w == k:
                continue
            # じゃんけんで勝ったとき
            if judge(T[v-1],w):
                dp[v][w] = max(dp[v][w],dp[v-K][k] + RSP[w])
            # じゃんけんで負けか引き分けたとき
            else:
                dp[v][w] = max(dp[v][w],dp[v-K][k])         
# K 個に分けた各グループの部分和の最大値の総和を求める
ans = 0
for a in range(1,K+1):
    ans += max(dp[-a])
print(ans)
print(2**(len(bin(int(nput()))) - 2) - 1)

### FIXED CODE ###

print(2**(len(bin(int(input()))) - 2) - 1)
import sys
S = input().strip()

for j in range(len(S)):
  for k in range(j+1,len(S)):
    if S[i] == 'C' and S[j] == 'F':
      print('Yes')
      sys.exit()
print('No')

### FIXED CODE ###

import sys
S = input().strip()

for j in range(len(S)):
  for k in range(j+1,len(S)):
    if S[j] == 'C' and S[k] == 'F':
      print('Yes')
      sys.exit()
print('No')
import math

h,w = list(map(int,input().split()))
x = (h*w)
if h ==1 or h == 1:
	print(1)
else:
	y = int(x /2)
	if x%2 == 0:
		print(y)
	else:
		print(y+1)

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(a[k-1])
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
#mod = 10 ** 9 + 7 
mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
xy = [LIST() for _ in range(N)]

xy.sort(key = lambda x: (x[0], x[1]))
diff = []

for s, t in combinations(xy, 2):
	st = str(t[0]-s[0]) + " " +str(t[1]-s[1])
	diff.append(st)

print(max(N - Counter(diff).most_common()[0][1], 1))



### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
#mod = 10 ** 9 + 7 
mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
xy = [LIST() for _ in range(N)]

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

xy.sort(key = lambda x: (x[0], x[1]))
diff = []

for s, t in combinations(xy, 2):
	st = str(t[0]-s[0]) + " " +str(t[1]-s[1])
	diff.append(st)

print(max(N - Counter(diff).most_common()[0][1], 1))
print('A'+upper(input()[0])+'C')

### FIXED CODE ###

s=input()
ss=s[8]
print("A"+ss+"C")
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1
    else:
        count=0
if count==1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()
if S[-1]=='s':
    s = S+'es'
else:
    s = S+'s'
print(s)
import math
a, b = map(int, input().split())
print(int(math.ceil(mean))

### FIXED CODE ###

import math
a, b = map(int, input().split())
mean = (a + b) / 2.0
print(math.ceil(mean))
from collections import Counter

n=int(input())
s=[input() for _ in range(n)]

cnt=0
cnt_a=0
cnt_b=0
cnt_ab=0
for i in range(n):
    if s[i][0]=='B' and s[i][-1]=='A':
        cnt_ab+=1
    elif s[i][0]=='B':
        cnt_b+=1
    elif s[i][-1]=='A':
        cnt_a+=1
    cnt+=s[i].count('AB')
if cnt_ab=0:
    ans=cnt+min(cnt_a,cnt_b)
elif:
    if cnt_a=0 and cnt_b=0:
        ans=cnt+cnt_ab-1
    else:
        ans=cnt+min(cnt_a,cnt_b)

print(ans)


### FIXED CODE ###

from collections import Counter

n=int(input())
s=[input() for _ in range(n)]

cnt=0
cnt_a=0
cnt_b=0
cnt_ab=0
for i in range(n):
    if s[i][0]=='B' and s[i][-1]=='A':
        cnt_ab+=1
    elif s[i][0]=='B':
        cnt_b+=1
    elif s[i][-1]=='A':
        cnt_a+=1
    cnt+=s[i].count('AB')
if cnt_ab==0:
    ans=cnt+min(cnt_a,cnt_b)
else:
    if cnt_a==0 and cnt_b==0:
        ans=cnt+cnt_ab-1
    else:
        ans=cnt+cnt_ab+min(cnt_a,cnt_b)

print(ans)
if a * b % 2 == 0:
	print "Even"
else:
	print "Odd"


### FIXED CODE ###

a, b = map(int, raw_input().split())

if a * b % 2 == 0:
	print "Even"
else:
	print "Odd"
m = map(int,input().split())

W = m[0]
H = m[1]
x = m[2]
y = m[3]
r = m[4]


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

### FIXED CODE ###

m = map(int,raw_input().split())

W = m[0]
H = m[1]
x = m[2]
y = m[3]
r = m[4]


if 0 <= x-r and x+r <= W and 0 <= y-r and y+r <= H:
    print "Yes"
else:
    print "No"
import collections

N = int(input())
v = list(int(i) for i in input().split())


gu = v[0::2]
ki = v[1::2]


gc = collections.Counter(gu)
kc = collections.Counter(ki)

guc = gc.most_common()
kic = kc.most_common()

gv = gc.values()
kv = kc.values()

if guc[0][0] != kic[0][0]:
    gcount = sum(gv) - max(gv)
    kcount = sum(kv) - max(kv)
    print(gcount+kcount)
else:
    if len(guc) == 1 and len(kic) == 1 :
        print(str(guc[0][1]))
    else:
        if len(guc) == 1 and len(kic) != 1 :
            print(str(sum(gv)+sum(kv)-max(gv)-kic[1][1]))
        elif len(guc) != 1 and len(kic) == 1 :
            print(str(sum(gv)+sum(kv)-max(kv)-guc[1][1]))
        else:
            print(str(sum(gv)+sum(kv)-max((guc[1][1] + kic[0][1]), (guc[0][1] + kic[1][1]))))


### FIXED CODE ###

S = input()


S = S.replace("9","!")
S = S.replace("1","9")
S = S.replace("!","1")

print(S)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from math import factorial 
def main():
    x, y = map(int, readline().split())
    if ((2*y-x)%3) or ((2*x-y)%3):
        print(0)
        return
    a = (2*y-x)//3
    b = (2*x-y)//3
    P = int(1e9)+7
    def c(n, m):
        ch = 1
        for i in range(m):
            ch *= (n-i)
            ch %= P
        b = factorial(m) 
        b = pow(b, P-2, P)
        return ch*b%P
    print(c(a+b, a)) 
if __name__ == '__main__':
    main()


### FIXED CODE ###

#python3
from math import factorial
from math import floor
MOD = int(1e9+7)

def comb(n, m, mod):
    comb_a = 1
    for i in range(m): 
        comb_a *= (n-i)
        comb_a %= mod
    comb_tmp = factorial(m) 
    comb_b = pow(comb_tmp, mod-2, mod)
    return (comb_a * comb_b)%mod
def main():
    x, y = map(int, input().split())
    k = (2*x-y)/3
    l = (2*y-x)/3

    if floor(k) - k != 0:
        print(0)
        return
    if floor(l) - l != 0:
        print(0)
        return 
    if k<0:
        print(0)
        return
    if l<0:
        print(0)
        return
    k = int(k)
    l = int(l)
    print(comb(k+l, k, MOD)%MOD) 

main()
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in l:
    if(i<a+k or i>b-k):
        print(i)


### FIXED CODE ###

a, b, k = map(int, input().split())
if((b-a)//2>=k):
    for i in range(k):
        print(a+i)
    for i in range(k):
        print(b-k+i+1)
else:
    for i in range(a, b+1):
        print(i)
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
c　= (a * b) % 2
if c == 1:
  print('Odd')
else:
  print('Even')


### FIXED CODE ###

# -*- coding: utf-8 -*-
a, b = map(int, input().split())
c = (a * b) % 2
if c == 0:
  print("Even")
else :
  print("Odd")
x, y, z, k = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)
useA = [a.pop(0)]
useB = [b.pop(0)]
useC = [c.pop(0)]
while True:
  if a[0] >= b[0] and a[0] >= c[0]:
    useA.append(a.pop(0))
    if len(a) == 0:
      a.append(0)
  elif b[0] >= a[0] and b[0] >= c[0]:
    useB.append(b.pop(0))
    if len(b) == 0:
      b.append(0)
  elif c[0] >= b[0] and c[0] >= a[0]:
    useC.append(c.pop(0))
    if len(c) == 0:
      c.append(0)
#  print( len(useA) * len(useB) * len(useC))
  if k**2 <= len(useA) * len(useB) * len(useC):
    break
ans = []
#print(useA, useB, useC)
for i in range(len(useA)):
  for j in range(len(useB)):
    for m in range(len(useC)):
      ans.append(useA[i] + useB[j] + useC[m])
ans.sort(reverse = True)
for i in range(k):
  print(ans[i])

### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = sorted(list(map(int, input().split())),reverse=True)
b = sorted(list(map(int, input().split())),reverse=True)
c = sorted(list(map(int, input().split())),reverse=True)
def search(a, b):
  ret = []
  al = len(a)
  bl = len(b)
  for i in range(min(al, k)):
    for j in range(min(bl, k-i)):
      ret.append(a[i] + b[j])
  ret.sort(reverse = True)
  return ret
d = search(a, b)      
e = search(c, d)    

for i in range(k):
  print(e[i])
n=int(input())
s=input()
v=[s[i: i+n/2] for i in range(0, len(s), n/2)]
if(len(set(v))==1):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
s=input()
if(n%2!=0):
  print("No")
else:
  v=[s[i: i+n//2] for i in range(0, len(s), n//2)]
  if(len(set(v))==1):
    print("Yes")
  else:
    print("No")
yohou = input().split("")
tenki = input().split("")
 
tekichu = 0
 
for i in range(0,3):
  if yohou[i] == tenki[i]:
    tekichu += 1
 
print(tekichu)


### FIXED CODE ###

s = list(input())
t = list(input())

cnt = 0
for i in range(3):
  if s[i] == t[i]:
    cnt += 1

print(cnt)
from collections import deque
S=input()
Q=int(input())

X=deque(list(S))
f=1
for _ in range(Q):
    t,ff,c=input().split()
    if t=="1":
        f*=-1
    else:
        if ff=="1":
            if f==1:
                X.appendleft(c)
            else:
                X.append(c)
        else:
            if f==-1:
                X.appendleft(c)
            else:
                X.append(c)

if f==-1:
    X.reverse()

print("".join(X))

### FIXED CODE ###

S=input()
Q=int(input())

X=[]
Y=[]
f=1
for _ in range(Q):
    A=list(input().split())
    if A[0]=="1":
        f*=-1
    if A[0]=="2":
        if A[1]=="1":
            if f==1:
                X.append(A[2])
            if f==-1:
                Y.append(A[2])
        if A[1]=="2":
            if f==-1:
                X.append(A[2])
            if f==1:
                Y.append(A[2])

x="".join(X)
x="".join(list(reversed(x)))
y="".join(Y)

a=[x,S,y]
b="".join(a)

if f==-1:
    b="".join(list(reversed(b)))

print(b)
h, w, m = map(int, input().split())
boms = set()
Hs = [0] * h
Ws = [0] * w
for i in range(m):
  _h, _w = map(int, input().split())
  boms.add([_h - 1,_w - 1])
  Hs[_h - 1] += 1
  Ws[_w - 1] += 1
Hmax = max(Hs)
Hcount = Hs.count(Hmax)
Wmax = max(Ws)
Wcount = Ws.count(Wmax)
Hindexs = [0] * Hcount
Windexs = [0] * Wcount
hcount = 0
wcount = 0
for i in range(h):
  if Hs[i] == Hmax:
    Hindexs[hcount] = i
    hcount += 1
for i in range(w):
  if Ws[i] == Wmax:
    Windexs[wcount] = i
    wcount += 1
count = 0
for bom in boms:
  if (bom[0] in Hindexs) and (bom[1] in Windexs):
    count += 1
if count == len(Hindexs) * len(Windexs):
  print(Hmax + Wmax - 1)
else:
  print(Hmax + Wmax)

### FIXED CODE ###

h, w, m = map(int, input().split())
boms = set()
Hs = [0] * h
Ws = [0] * w
for i in range(m):
  _h, _w = map(int, input().split())
  boms.add((_h - 1, _w - 1))
  Hs[_h - 1] += 1
  Ws[_w - 1] += 1
Hmax = max(Hs)
Hcount = Hs.count(Hmax)
Wmax = max(Ws)
Wcount = Ws.count(Wmax)
Hindexs = [0] * Hcount
Windexs = [0] * Wcount
hcount = 0
wcount = 0
for i in range(h):
  if Hs[i] == Hmax:
    Hindexs[hcount] = i
    hcount += 1
for i in range(w):
  if Ws[i] == Wmax:
    Windexs[wcount] = i
    wcount += 1
if m < len(Hindexs) * len(Windexs):
  print(Hmax + Wmax)
  exit()
for hindex in Hindexs:
  for windex in Windexs:
    if (hindex,windex) not in boms: 
      print(Hmax + Wmax)
      exit()
print(Hmax + Wmax -1)
n = int(input())

a = []
b = []
aa = []
for i in range(n):
	k,l = map(int,input().split())
	a.append(k)
	b.append(l)
	aa.append([k,l])
dp = [[0,0] for i in range(n+1)]
aa.sort(key = lambda x:x[1])
co = 0
for i in range(n):
	for j in range(n):
		if i % 2 == 0:		
			dp[i+1] = max(dp[i]+aa[j][i%2],dp[i+1])
		else:
			dp[i+1] = max(dp[i]-aa[j][i%2],dp[i+1])

print(dp[n+1])

### FIXED CODE ###

import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


n = onem()

po = []
su = 0
for i in range(n):
    a,b = m()
    po.append([a+b,a])
po.sort(reverse = True)

for i in range(n):
    if i % 2 == 0:
        su += po[i][1]
    else:
        su -= po[i][0] - po[i][1]
print(su)