Harryxun/stf_run huggingface dataset:
mod = 10 ** 9 + 7

class Solution:
    def FactorialMod(self, n):
        if n <= 1:
            return 1
        else:
            return n * self.FactorialMod(n - 1) % mod
    def ModInv(self, p):
        if p <= 1:
            return 1
        return (-self.ModInv(mod % p) * (mod // p)) % mod
    def FactorialModInv(self, p):
        if p <= 1:
            return 1
        return modinv_table[p] * self.FactorialModInv(p - 1)
    def Solve(self, n):
        ans = 0
        #Fill in the modinv_table
        for p in range(2, n + 1):
            modinv_table[p] = (-modinv_table[mod % p] * (mod // p)) % mod
        # print(modinv_table)
        for item in range(1, max_items + 1):
            # print("----------------------------------")
            # print("item", item)
            max_value = S - 3 * item
            # print("max_value", max_value)
            add = self.CalculateAddition(max_value, item)
            # print("add", add)
            ans += add
            ans %= mod
        return ans
    def CalculateAddition(self, max_value, item):
        if max_value == 0:
            return 1
        add = 1
        add = add * self.FactorialMod(max_value + item - 1) % mod
        add = add * self.FactorialModInv(max_value) % mod
        add = add * self.FactorialModInv(item - 1) % mod
        return add

S = int(input())
if S <= 2:
    print(0)
    exit()

max_items = S // 3
# print("max_items", max_items)
modinv_table = [-1] * (S + 1)
modinv_table[1] = 1

sol = Solution()
print(sol.Solve(S))


### FIXED CODE ###

S = int(input())
mod = 10 ** 9 + 7

if S <= 2:
    print(0)
    exit()

ans = 0
max_items = S // 3

# print("max_items", max_items)

for item in range(1, max_items + 1):
    # print("---------------------------")
    # print("item", item)
    n = S - 3 * item
    # print("n", n)
    if n == 0:
        ans += 1
        break

    modinv_table = [-1] * (n + 1)
    modinv_table[1] = 1
    for i in range(2, n + 1):
        modinv_table[i] = (-modinv_table[mod % i] * (mod // i)) % mod

    add = 1
    for p in range(n):
        add *= (n + item - 1) - p
        add *= modinv_table[p + 1]
        add %= mod


    # print("add", add)


    ans += add
    ans %= mod



print(ans)
N, M = input().split()
N = int(N)
M = int(M)

def diffculc(st, ed):
    if ed < st:
        tmp = ed
        ed = st
        st = tmp
    if st < 0 and ed < 0:
        diff = abs(st - ed)
    elif -1 < st and ed < 0:
        diff = abs(ed - st)
    elif st < 0 and -1 < ed:
        diff = abs(st - ed)
    elif -1 < st and -1 < ed:
        diff = ed - st
    return diff

xList = [int(x) for x in input().split()]
sortedList = sorted(xList)

# 0番目と1番目の間のdiffはdiffcache[0]
diffcache = {}
diff = 0
for i, x in enumerate(sortedList):
    if i == len(sortedList) - 1:
        break
    diffcache[i] = diffculc(sortedList[i+1], x)

rangeset = []
counter = 0
for k, v in sorted(diffcache.items(), key=lambda x: -x[1]):
    if counter == N - 1:
        break
    diffcache.pop(k)
    counter = counter + 1

result = 0
for k,v in diffcache:
    result = result + v
print(result)

### FIXED CODE ###

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

def diffculc(st, ed):
    if ed < st:
        tmp = ed
        ed = st
        st = tmp
    if st < 0 and ed < 0:
        diff = abs(st - ed)
    elif -1 < st and ed < 0:
        diff = abs(ed - st)
    elif st < 0 and -1 < ed:
        diff = abs(st - ed)
    elif -1 < st and -1 < ed:
        diff = ed - st
    return diff

xList = [int(x) for x in input().split()]
sortedList = sorted(xList)

# 0番目と1番目の間のdiffはdiffcache[0]
diffcache = {}
diff = 0
for i, x in enumerate(sortedList):
    if i == len(sortedList) - 1:
        break
    diffcache[i] = diffculc(sortedList[i+1], x)

rangeset = []
counter = 0
for k, v in sorted(diffcache.items(), key=lambda x: -x[1]):
    if counter == N - 1:
        break
    diffcache.pop(k)
    counter = counter + 1

result = 0
for k,v in diffcache.items():
    result = result + v
print(result)
s = str(input())
t = str(input())

Z =False

if i in range(lens(s)):
    s = s[-1] + s[:-1]
    if s == t:
        Z =True
        break
        
print('Yes' if Z else 'No')

### FIXED CODE ###

s = str(input())
t = str(input())

for i in range(len(s)):
    ss = s[-i:]+s[:-i]
    if ss == t:
        print('Yes')
        exit()
print('No')
s = input()
K = (int)(input())
k = K
for n in s:
  if n != '1':
    print(n)
    exit(1)
print('1')


### FIXED CODE ###

s = input()
k = (int)(input())

c = 0
for ch in s:
  if not ch == '1':
    break
  c += 1
n = s[c] if c < len(s) else None
a = n if n and c < k else s[0]
print(a)
v

### FIXED CODE ###

n = int(input())

i = 0
while i*1000<n:
    i += 1

print((i)*1000-n)
#python3
import math
a,b=map(int, input().split())
print(a*b//math.gcd(a,b))


### FIXED CODE ###

#python3
a, b = map(int, input().split())
def gcd(x, y):
  if x%y == 0:
    return y
  else :
    return gcd(y, x%y) 

def lcm(x, y):
  return x*y//gcd(x, y)

print(lcm(a, b))
n=int(input())
d={int(input()) for i in range(n)}
print(len(d))

### FIXED CODE ###

print('2018'+input()[4:])
def mx(ls,i):
    rls = ls[:]
    if i <= 0 or len(rls) == 0: return 0
    else     : return (i+1)*rls.pop()+ mx(rls,i-1)

def cns(ls,m,sm):
    global n, s
    count = 0
    if m == n:
        if sm == s: return 1
        else      : return 0
    elif s-mx(ls,n-m) <= sm <= s:
        for i in range(9-m+1):
            rls = ls[:]
            k = rls.pop(i)
            count += cns(rls,m+1,sm+(m+1)*k)
        return count
    else: return 0

ls = [0,1,2,3,4,5,6,7,8,9]
while True:
    n, s = map(int, raw_input().split())
    if s > mx(ls,n): print 0
    else        : print cns(ls,0,0)

### FIXED CODE ###

def mxmn(ls,m):
	global n
	s1,s2 = 0, 0
	for i in range(m):
		s1 += (n-i)*ls[-i-1]
		s2 += (n-i)*ls[i]
	return s1,s2

def f(ls,m,s):
	global n
	count = 0
	if m > 0:
		mx,mn = mxmn(ls,m)
		if mx < s or mn > s: return 0
		elif mx == s or mn == s: return 1
		for i in range(len(ls)):
			lls = ls[:]
			a = (n-m+1)*lls.pop(i)
			if s-a < 0:	break
			else: count += f(lls,m-1,s-a)
		return count
	else:
		return 1 if s == 0 else 0
			
ls = [i for i in range(10)]
while True:
	try:
		n,s = map(int, raw_input().split())
		print f(ls,n,s)
	except:
		break
dic = {'dog':5,'fish':4,'tiger':3,'cat':2,'lion':1}
taro_p = 0
hana_p = 0
for i in range(input()):
    taro,hana = raw_input().split(' ')
    if dic[taro] > dic[hana]:
        taro_p = taro_p + 3
        hana_p = hana_p + 0
    elif dic[taro] < dic[hana]:
        taro_p = taro_p + 0
        hana_p = hana_p + 3
    else:
        taro_p = taro_p + 1
        hana_p = hana_p + 1

print taro_p,hana_p

### FIXED CODE ###

taro_p = 0
hana_p = 0
for i in range(input()):
    taro,hana = raw_input().split(' ')
    if taro > hana:
        taro_p = taro_p + 3
        hana_p = hana_p + 0
    elif taro < hana:
        taro_p = taro_p + 0
        hana_p = hana_p + 3
    else:
        taro_p = taro_p + 1
        hana_p = hana_p + 1

print taro_p,hana_p
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
ans = a[0]
for i in range(1, n):
    ans = ans*a[i]//gcd(ans, a[i])
# s = sum(pow(x, mod-2, mod) for x in a)
s = sum(1/x for x in a)
print(int(s*ans%mod))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
from math import gcd
cm = 1
for i in range(n):
    cm = cm*a[i]//gcd(cm, a[i])
ai = sum(pow(x, mod-2, mod) for x in a)
print(int(ai*cm%mod))
ab=[sum(map(int, input().split())) for i in range(int(input()))]
ab.sort(reverse=True)
print(ab[::2]-ab[1::2])

### FIXED CODE ###

#A
"""
n, a, b = map(int, input().split())
ab = n / 2
ansa = min(a, b)
ansb = max((a+b)-n, 0)
print(ansa,ansb)
"""

#B
"""
n = int(input())
a = input()
b = input()
c = input()
ans = 0
for i in range(n):
    bf = [a[i], b[i], c[i]]
    bf = set(bf)
    ans += len(bf) - 1
print(ans)
"""

#C 

n = int(input())
ab = []
aba = []
abb = []
for i in range(n):
    a,b = map(int, input().split())
    ab.append([a + b, i])
    aba.append(a)
    abb.append(b)
ab.sort(reverse = True, key = lambda x:x[0])
ans = 0
for i in range(n):
    if i % 2 == 0:
        ans += aba[ab[i][1]]
    else:
        ans -= abb[ab[i][1]]
print(ans)


#D
"""
n, m = map(int, input().split())
ab = [[] for _ in range(n)]
for i in range(n + m - 1):
    a,b = map(int, input().split())
    ab[a-1].append(b-1)
print(ab)
ans = [0 for i in range(n)]
def yosozero(i):
    if ans[i]
"""
n = int(input())
a = list(map(int, input().split()))

b = []
for aa in a:
    b.append(aa)
    b.reverse()

ans = ''
for bb in b:
    ans += bb + ' '

print(ans[:-1])


### FIXED CODE ###

from collections import deque

n = int(input())
a = list(input().split())

b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
if n % 2 == 1:
    b.reverse()

print(' '.join(b))
n,x = map(int, input().split())
m=[]
for i in range(n): m.append(int(input()))
m.sort()
nokori = x - sum(m)
kosuu  = nokoro // m[0]
print(len(m) + kosuu)

### FIXED CODE ###

n,x = map(int, input().split())
m=[]
for i in range(n): m.append(int(input()))
m.sort()
nokori = x - sum(m)
kosuu  = nokori // m[0]
print(len(m) + kosuu)
K,X=list(map(int,input().split()))
min = max(X - (K -1),-1000000)
max = min (X + (K-1),1000000)
for i in range(min,max+1):
    ans.append(i)
print(' '.join(ans))

### FIXED CODE ###

K,X=list(map(int,input().split()))
Min = max(X - (K -1),-1000000)
Max = min(X + (K-1),1000000)
ans = []
for i in range(Min,Max+1):
    ans.append(i)
ans = map(str,ans)
ans = ' '.join(ans)
print(ans)
n = int(raw_input())
k = int(raw_input())
x = int(raw_input())
y = int(raw_input())
if n < = k:
  print(x*n)
else:
  print(x*k+y*(n-k))

### FIXED CODE ###

n = int(raw_input())
k = int(raw_input())
x = int(raw_input())
y = int(raw_input())
if n <= k:
  print(x*n)
else:
  print(x*k+y*(n-k))
a, b = input().split()
is_square = False
for i in range(1, 101):
  if i**2 == int(a * b):
    is_square = True
    break
print('Yes' if is_square else 'No')

### FIXED CODE ###

a, b = input().split()
is_square = False
for i in range(1, 317):
  if i**2 == int(a + b):
    is_square = True
    break
print('Yes' if is_square else 'No')
from collections import defaultdict

mem = {}


def binomialCoeff(n, k):
    if n < k:
        return 0
    if k == 0 or k == n:
        return 1
    if n in mem.keys():
        return mem[n]

    # Recursive Call
    mem[n] = binomialCoeff(n - 1, k - 1) + binomialCoeff(n - 1, k)
    return mem[n]


if __name__ == '__main__':
    n = int(input())
    xs = [int(s) for s in input().split()]
    freq = defaultdict(int)
    xs_res = defaultdict(int)

    for n in xs:
        freq[n] += 1
        if freq[n] > 2:
            xs_res[n] *= 2
        if freq[n] > 1:
            xs_res[n] += 1

    res = 0

    for k in range(len(xs)):
        res = 0
        for num in freq.keys():
            res += binomialCoeff(freq[num] if num != xs[k] else freq[num] - 1, 2)
        print(res)


### FIXED CODE ###

from collections import defaultdict


def num_combinations(_n):
    return _n * (_n - 1) // 2


if __name__ == '__main__':
    n = int(input())
    xs = [int(s) for s in input().split()]
    freq = defaultdict(int)

    for n in xs:
        freq[n] += 1

    total = sum([num_combinations(n) for n in freq.values()])
    for x in xs:
        print(total - (freq[x] - 1))
n = int(input().split())
for a in list(map(int, input().split())):
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')

### FIXED CODE ###

n = int(input())
for a in list(map(int, input().split())):
  if a % 2 == 0:
    if a % 3 != 0 and a % 5 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')
n = int(input())

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

n = input()

if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = np.array([inputs_number() for i in range(N)])

    inf = 100*N + 1
    dp = np.ones((N,N*10,N*10)) * inf
    dp[0,0,0] = 0
    for i in range(0, N-1):
	for ca in range(N*10):
            for cb in range(N*10):
		if(dp[i,ca,cb]==inf):
                    continue
		dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]]);
		dp[i+1,ca+drugs[i,0],cb+drugs[i,1]]=np.min([dp[i+1,ca+drugs[i,0],cb+drugs[i,1]],dp[i,ca,cb]+drugs[i,2]]);

    ans = inf
    for i in range(1, N):
	for ca in range(1, N*10):
            for cb in range(1, N*10):
		if(Ma*cb == Mb*ca and dp[i,ca,cb] < ans):
                    ans = dp[i,ca,cb]
    if(ans==inf):
	ans = -1
    print(int(ans))

### FIXED CODE ###

import numpy as np
import copy

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = [inputs_number() for i in range(N)]
    inf = 100*N + 1
    dp = np.ones((2,N*10+1,N*10+1)).astype(np.int32) * inf
    dp = dp.tolist()
    dp[0][0][0] = 0.0

    for i in range(N):
        for ca in range(10*i+1):
            for cb in range(10*i+1):
                if(dp[0][ca][cb]==inf):
                    continue
                dp[1][ca][cb]=min([dp[1][ca][cb], dp[0][ca][cb]])
                dp[1][ca+drugs[i][0]][cb+drugs[i][1]]=min([dp[1][ca+drugs[i][0]][cb+drugs[i][1]], dp[0][ca][cb]+drugs[i][2]])
        dp[0] = copy.copy(dp[1])
        dp[1] = (np.ones((N*10+1,N*10+1)).astype(np.int32) * inf).tolist()
    ans = inf
    for ca in range(1, N*10+1):
        for cb in range(1, N*10+1):
            if(Ma*cb==Mb*ca and dp[0][ca][cb]<ans):
                ans = dp[0][ca][cb]
    if(ans==inf):
        ans = -1
    print(int(ans))
def str_read(s):

    if len(s) == 0:
        return True
    else:
        flag = False
        if len(s) > 4 and s[0:5] in ['dream', 'erase']:
            flag = flag or str_read(s[5:])
        if len(s) > 5 and s[0:6] in['eraser']:
            flag = flag or str_read(s[6:])
        if len(s) > 6 and s[0:7] in['dreamer']:
            flag = flag or str_read(s[7:])
        return flag


s = input()

if str_read(s):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def str_read(s):
    while True:
        if len(s) == 0:
            return True
        else:
            if s[0:5] in ['maerd', 'esare']:
                s = s[5:]
            elif s[0:6] in ['resare']:
                s = s[6:]
            elif s[0:7] in ['remaerd']:
                s = s[7:]
            else:
                return False


si = input()
if str_read(si[::-1]):
    print('YES')
else:
    print('NO')
inf = float("INF")
a,b,q = map(int, input().split())
s = [None] * (a + 3)
s[0:2] = [-inf,-inf]
s[-1] = inf
t = [None] * (b + 3)
t[0:2] = [-inf,-inf]
t[-1] = inf
for i in range(a):
	s[i+2] = int(input())
for i in range(b):
	t[i+2] = int(input())

from bisect import bisect_left

dp0 = [None] * (a+3)
dp1 = [None] * (b+3)

def f(s,t,x,ss,i):
  if i == 0 and dp0[ss] != None: return abs(x - s[ss]) + dp0[ss]
  elif i == 1 and dp1[ss] != None: return abs(x - s[ss]) + dp1[ss]
  tr = bisect_left(t, s[ss])
  tl = tr - 1
  if i == 0: dp0[ss] = min(abs(s[ss] - t[tl]), abs(s[ss] - t[tr]))
  if i == 1: dp1[ss] = min(abs(s[ss] - t[tl]), abs(s[ss] - t[tr]))
  return abs(x - s[ss]) + min(abs(s[ss] - t[tl]), abs(s[ss] - t[tr]))


for _ in range(q):
  ans = inf
  x = int(input())
  sr = bisect_left(s, x)
  ans = min(ans, f(s,t,x,sr,0))
  ans = min(ans, f(s,t,x,sr - 1,0))
  tr = bisect_left(t, x)
  ans = min(ans, f(t,s,x,tr,1))
  ans = min(ans, f(t,s,x,tr - 1,1))
  print(ans)
  


### FIXED CODE ###

#A


s = input().split("/")
if int(s[1]) <= 4:
    print("Heisei")
else:
    print("TBD")

#B
"""
n = int(input())
ans = 0
for i in range(n):
    a = input().split()
    if a[1] == "JPY":
        ans += int(a[0])
    else:
        ans +=  float(a[0]) * 380000
print(ans)
"""
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = [""] * L
for i in range(N):
    idx = i * (L // N)
    # x[idx] = S[i]
    print(S[i])
for i in range(M):
    idx = i * (L // M)
    if x[idx] != "" and x[idx] != T[i]:
        print(-1)
        exit()
print(L)


### FIXED CODE ###

import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N, M = map(int, input().split())
S = input()
T = input()
L = lcm(N , M)
x = {}
for i in range(N):
    idx = i * (L // N)
    x[idx] = S[i]
for i in range(M):
    idx = i * (L // M)
    if idx in x and x[idx] != T[i]:
        print(-1)
        exit()
print(L)
n, m = map(int, input().split())
a = list(map(int, input().split()))

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - 
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

if popular_num >= m:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - i
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

if popular_num >= m:
  print('Yes')
else:
  print('No')
n, a, b = map(int, input().split())
count = 0
for i in range(1, N+1):
    if a <= sum(map(int, str(i))) <= b:
        count += 1
print(count)


### FIXED CODE ###

import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


N, A, B = LI()
ans = 0
for i in range(1, int(N)+1):
    si = str(i)
    sum = 0
    for sii in si:
        sum += int(sii)
    if A <= sum <= B:
        ans += i
print(ans)
import itertools
import math

N, D = [int(x) for x in input().strip().split()]
if D == 1:
    print(int(N*(N-1)/2)
else:    
    points = []
    for data in range(N):
        points.append([int(x) for x in input().strip().split()])

    result = 0
    for p1,p2 in itertools.combinations(points, 2):
        distance = 0
        for y,z in zip(p1,p2):
            distance += (y - z) ** 2
        
        distance = math.sqrt(distance)
        if distance.is_integer(): result += 1    
    print(result)

### FIXED CODE ###

import itertools
import math

N, D = [int(x) for x in input().strip().split()]
if D == 1:
    print(int(N*(N-1)/2))
else:
    points = []
    for data in range(N):
        points.append([int(x) for x in input().strip().split()])

    result = 0
    for p1,p2 in itertools.combinations(points, 2):
        distance = 0
        for y,z in zip(p1,p2):
            distance += (y - z) ** 2
        
        distance = math.sqrt(distance)
        if distance.is_integer(): result += 1    
    print(result)
a,s,d=input().split()
f,g,h=input().split()
j,k,l=input().split()
print(a+g+k)

### FIXED CODE ###

a=input()
f=input()
j=input()
print(a[0]+f[1]+j[2])
n =int(input())
a=(int(x) for x in input().split())
x = 0
for i in range(n):
    for j in range(n - i - 1):
        if a[i] == a[i + j + 1]:
            print("Yes")
            x = 1
            break

if x == 0:
    print("No")


### FIXED CODE ###

n = int(input())
a = list(int(x) for x in input().split())
x = 0
 
a.sort()
for i in range(n-1):
    if a[-1] - a[-2] == 0:
        print("NO")
        x = 1
        break
    a.pop()
 
if x == 0:
    print("YES")
import math
 
def main():
  N = int(input())
  
  if N==2:
    print(2)
  else:
    print(search(N))
 
# xは奇数を前提
def search(x):
  
  # 2は確認不要
  ints = list(range(3,x))
  
  # 順に確認する
  for i in ints:
    
    
    if x%i==0:
      seartch(x+2)
  	elif x < i**2:
      break
    
  return x

main()

### FIXED CODE ###

print("".join(input().split(" ")[::-1]))
def m():

    def is_satisfied(p):
        for i in range(N):
            if i+1 == p[i]: return False
        return True

    def swap(i):
        tmp = p[i]
        p[i] = p[i+1]
        p[i+1] = tmp

    N = int(input())
    p = list(map(int, input().split()))
    if is_satisfied(p):
        return 0

    cnt = 0
    for i in range(N):
        if i+1 == p[i]:
            swap(i)
            cnt +=1
    return cnt

print(m())

### FIXED CODE ###

def m():
    def is_satisfied(p):
        for i in range(N):
            if i + 1 == p[i]: return False
        return True

    def swap(i):
        tmp = p[i]
        p[i] = p[i + 1]
        p[i + 1] = tmp

    N = int(input())
    p = list(map(int, input().split()))
    if is_satisfied(p):
        return 0

    cnt = 0
    for i in range(N):
        if i + 1 == p[i]:
            if i + 1 == N:
                cnt += 1
                tmp = p[i - 1]
                p[i - 1] = p[i]
                p[i] = tmp
            else:
                swap(i)
                cnt += 1
    return cnt


print(m())
a = int(input())
b = int(input())
if a*b % 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")
N=int(input())
A_=set(list(map(int,input().split())))
print(len(A_))


### FIXED CODE ###

N=int(input())
A_=set([input() for i in range(N)])
print(len(A_))
W,H,x,y=map(int, input().split())
  D = 0.5*H*W
  if W//x==2 and H//y==2:
    R = 1:
  else:
    R = 0
print(D, R)


### FIXED CODE ###

W,H,x,y=map(int, input().split())
D = 0.5*H*W
if W == 2*x and H==2*y:
  R = 1
else:
  R = 0
print(D, R)
s = input()
di = {}
for c in s:
  di[c] = 0
for c in s:
  di[c] +=1
  
is_beautiful = True
for c in s:
  if di[c] %2 ==1:
    is_beautiful = False

print('Yes' is is_beautiful else 'No')

### FIXED CODE ###

s = input()
di = {}
for c in s:
  di[c] = 0
for c in s:
  di[c] +=1
  
is_beautiful = True
for c in s:
  if di[c] %2 ==1:
    is_beautiful = False

print('Yes' if is_beautiful else 'No')
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
    else:
      b1=0
    print(a1,b1)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
  else:
    b1=0
  print(a1,b1)
a,b = [int(j) for j in input().split()]
print(max(a-2*b, 0)

### FIXED CODE ###

a,b = [int(j) for j in input().split()]
print(max(a-2*b, 0))