Harryxun/stf_run huggingface dataset:
t = input()

ans = t
tem = ''
if '?' in t :  
    if len(t) == 1 :
        ans = 'D'
    elif len(t) == 2 :
        if t[0] == '?' and t[1] == '?' :
            ans = 'PD'
        elif t[0] == '?' and t[1] == 'D':
            ans = 'PD'
        elif t[0] == '?' and t[1] == 'P':
            ans ='DP'
        elif t[1] == '?' and t[0] == 'P':
            ans = 'PD'
        elif t[1] == '?' and t[0] == 'D':
            ans = 'DD'
    else:
        for i in range(0,len(t)):
            if i == 0 :
                if t[i] == '?' and t[i+1] == 'P':
                    ans = 'D'
                else :
                    ans = 'P'
                    
            elif i == len(t) :
                if t[i] == '?' :
                    ans += 'D'
                else:
                    ans += t[i]
            else:
                if t[i] == '?':
                    if ans[i-1] == 'P':
                        ans += 'D'
                    elif t[i+1] == 'D':
                        ans += 'P'
                    else:
                        ans += 'D'
                else:
                    ans += t[i]
print(ans)

### FIXED CODE ###

t = input()

ans = t
tem = ''
if '?' in t :  
    if len(t) == 1 :
        ans = 'D'
    elif len(t) == 2 :
        if t[0] == '?' and t[1] == '?' :
            ans = 'PD'
        elif t[0] == '?' and t[1] == 'D':
            ans = 'PD'
        elif t[0] == '?' and t[1] == 'P':
            ans ='DP'
        elif t[1] == '?' and t[0] == 'P':
            ans = 'PD'
        elif t[1] == '?' and t[0] == 'D':
            ans = 'DD'
    else:
        for i in range(0,len(t)):
            if i == 0 :
                if t[i] == '?' and t[i+1] == 'P':
                    ans = 'D'
                elif t[i] == '?' :
                    ans = 'P'
                else :
                    ans = t[i] 
                    
            elif i == len(t)-1 :
                if t[i] == '?' :
                    ans += 'D'
                else:
                    ans += t[i]
            else:
                if t[i] == '?':
                    if ans[i-1] == 'P':
                        ans += 'D'
                    elif t[i+1] == 'D' or t[i+1] == '?':
                        ans += 'P'
                    else:
                        ans += 'D'
                else:
                    ans += t[i]
print(ans)
n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
    	for z in range(1, 101):
      		a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])

### FIXED CODE ###

n = int(input())
a = [0] * 10**5
for x in range(1, 101):
	for y in range(1, 101):
		for z in range(1, 101):
			a[x**2 + y**2 + z**2 + x*y + y*z + z*x] += 1
for i in range(1, n + 1):
	print(a[i])
n, m = map(int, input().split())
li = []
for i in range(m):
  li.append(list(input().split()))
li_a = [0 for i in range(m)]
li_b = [0 for i in range(m)]
a = 0
b = 0
for j in range(m):
  if li[j][1] == "WA":
    li_b[int(li[j][0])] += 1
  elif li[j][1] == "AC" and li_a[j] == 0:
    a += 1
    b += li_b[int(li[j][0])]
    li_a[int(li[j][0])] += 1
print(a, b)

### FIXED CODE ###

n, m = map(int, input().split())
li = []
for i in range(m):
  li.append(list(input().split()))
li_a = [0 for i in range(n)]
li_b = [0 for i in range(n)]
a = 0
b = 0
for j in range(m):
  if li[j][1] == "WA":
    li_b[int(li[j][0])-1] += 1
  elif li[j][1] == "AC" and li_a[int(li[j][0])-1] == 0:
    a += 1
    b += li_b[int(li[j][0])-1]
    li_a[int(li[j][0])-1] += 1
print(a, b)
b = input()
if b = 'A':
  print('T')
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
else:
  print('C')

### FIXED CODE ###

b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
else:
  print('C')
N, M = (int(_) for _ in input().split())
a = [0 for i in range(M)]
MOD = 10 ** 9 + 7
for i in range(M):
    a[i] = int(input())
a.append(0)
dp = [0 for i in range(N + 1)]
j = 0
for i in range(N + 1):
    if i == a[j]:
        j += 1
    elif i == 0:
        dp[i] = 1
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp[N] % MOD)

### FIXED CODE ###

#ABC129 C
N, M = (int(_) for _ in input().split())
a = [0 for i in range(M)]
MOD = 10 ** 9 + 7
for i in range(M):
    a[i] = int(input())
a.append(0)
dp = [0 for i in range(N + 1)]
j = 0
for i in range(N + 1):    
    if i == a[j] and M != 0:
        j += 1
    elif i == 0:
        dp[i] = 1
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = dp[i - 1] + dp[i - 2]
print(dp[N] % MOD)
a,b=input().split()

a=list(a)
b=list(b)
a0=int(''.join(a))
a1=int(''.join(a[:-1]))
a2=int(''.join(a[:-2]))
b0=int(b[0])
b1=int(b[2])
b2=int(b[3])
ss=a0*b0+a1*b1+a2*b2
print(ss)

### FIXED CODE ###

# fp = open('integer.txt')
A,B = input().split()
B = B.split('.')
B = B[0]+B[1]
B = int(B)
X = str(int(A)*B)
if len(X)<=2:
    print(0)
else:
    print(X[0:len(X)-2])
H,W=map(int,input().split())

a =[list(input()) for i in range(W)]

i=0
rm=0
for i in range(H):
  if a[i].count('#')==0:
    k=i
    for j in range(H-k-1):
      a[k+j]=a[k+j+1]
    H=H-1
    
for j in range(W):
  flag=1
  for i in range(H):
    #print(i,j,a[i][j])
    if a[i][j]=='#':
      flag=flag*0
  if flag==1:
    for i in range(H):
      a[i][j]='-' 
    W=W-1

for i in range(H) :
  if a[i].count('-')!=0:
    a[i].remove('-')
  
ans=list('' for i in range(W))

N=len(a[0])

for i in range(H):
  for j in range(N):
    ans[i]=ans[i]+a[i][j]
    
for i in range(H):
  print(ans[i])

### FIXED CODE ###

H,W=map(int,input().split())

A = [list(input()) for i in range(H)]

l=[False]*H
c=[False]*W

for i in range(H):
  for j in range(W):
    if A[i][j]=='#':
      l[i]=True
      c[j]=True

ans=['' for i in range(H)]
for i in range(H):
  for j in range(W):
    if l[i] and c[j]:
      ans[i]+=A[i][j]
for i in range(H):
  if str(ans[i])!='':
    print(str(ans[i]))
N = int(input())
a = list(map(int, input().split()))

if len(a) == 2:
    x = a[0]
    y = a[-1]
    print(abs(x-y))
    exit()


total = sum(a)
mid = total//2

for i in range(1, N):
    x += a[i]
    if x <= mid:
        continue
    else:
        print(min(abs(x-a[i]-(total - (x-a[i]))), abs(x-(total - x))))
        exit()

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
x = a[0]
total = sum(a)
y = total - x
ans = abs(x - y)
for i in range(1, N-1):
    x += a[i]
    y -= a[i]
    m = abs(x-y)
    if ans > m:
        ans = m
print(ans)
n, m = [int (input().split(" ")]

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)
    

### FIXED CODE ###

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

a =[ [int(i) for i in input().split(" ")] for _ in range(n) ]
b =[]
for i in range(m):
    b.append( int(input()) )


for x in range(n):
    result = 0
    for y in range(m):
        result += a[x][y] * b[y]
    print(result)
N = int(input())
memo = [0]*N
memo[0] = 2
memo[1] = 1
for n in range(2,N):
    memo[n] = memo[n-1]+memo[n-2]
print(memo[N])

### FIXED CODE ###

N = int(input())
memo = [0]*(N+1)
memo[0] = 2
memo[1] = 1
for n in range(2,N+1):
    memo[n] = memo[n-1]+memo[n-2]
print(memo[-1])
n = int(input())
f = [0] * n
f[0] = 2
f[1] = 1
for i in range(2,n):
    f[i] = f[i-1] + f[i-2]
print(f[-1])

### FIXED CODE ###

n = int(input())
f = [0] * (n+1)
f[0] = 2
f[1] = 1
for i in range(2,n+1):
    f[i] = f[i-1] + f[i-2]
print(f[-1])
N, M = map(int, input().split())
X=[]
for i in range(M):
    X.append(list(map(int, input().split())))
P=list(map(int, input().split()))
ans=0

key='{:0'+str(N)+"b}"
for k in range(2**N):
    
    switch=list(key.format(k))
    for i in range(M):
        
        odd=1
		even=0
        if P[i]==1:
            odd=0
            for j in range(X[i][0]):
                odd+=int(switch[ X[i][j+1]-1] )
            if odd%2==0:
                break
            
        else:
            even=0
            for j in range(X[i][0]):
                even+=int(switch[ X[i][j+1]-1] )
            if even%2==1:
                break
    
    if odd%2==1 and even%2==0:
        ans+=1
        #print(X[i],switch,odd,even)
            
print(ans)






### FIXED CODE ###

N, M = map(int, input().split())
X=[]
for i in range(M):
    X.append(list(map(int, input().split())))
P=list(map(int, input().split()))
ans=0

key='{:0'+str(N)+"b}"
for k in range(2**N):
    
    switch=list(key.format(k))
    for i in range(M):
        odd=1
        even=0
        if P[i]==1:
            odd=0
            for j in range(X[i][0]):
                odd+=int(switch[ X[i][j+1]-1] )
            if odd%2==0:
                break
            
        else:
            even=0
            for j in range(X[i][0]):
                even+=int(switch[ X[i][j+1]-1] )
            if even%2==1:
                break
    
    if odd%2==1 and even%2==0:
        ans+=1
        #print(X[i],switch,odd,even)
            
print(ans)
H,W,A,B=map(int,input().split())
Ans=[["0"]*W for _ in range(H)]
for i in range(A, W):
    for j in range(B):
        Ans[i][j]="1"
for i in range(A):
    for j in range(B,H):
        Ans[i][j]="1"
for a in Ans:
    moji="".join(a)
    print(moji)

### FIXED CODE ###

H,W,A,B=map(int,input().split())
Ans=[["0"]*W for _ in range(H)]
if B>0:
    for i in range(A, W):
        for j in range(B):
            Ans[j][i]="1"
if A>0:
    for i in range(A):
        for j in range(B,H):
            Ans[j][i]="1"
for a in Ans:
    moji="".join(a)
    print(moji)
N = int(input())
if N %2 ==0:
  prnit(0.5)
else:
  print(2/(N+1))

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
  print(0.5000000000)
else:
  print((N+1)/(2*N))
H, W, D = [int(x) for x in input().strip().split(' ')]
stage = {}
for i in range(H):
    nums = [int(x) for x in input().strip().split(' ')]
    for j in range(W):
        stage[nums[j]] = [i + 1, j + 1]
Q = int(input())
tests = []
for _ in range(Q):
    tests.append([int(x) for x in input().strip().split(' ')])

scores = []
done = {}
for i in range(Q):
    L, R = tests[i]
    if (L, R) in done:
        scores.append(done[[L, R]])
    elif L == R:
        scores.append(0)
    else:
        x, y = stage[L]
        score = 0
        while L < R:
            new_x, new_y = stage[L + D]
            score += abs(new_x - x) + abs(new_y - y)
            x = new_x
            y = new_y
            L += D
        scores.append(score)
        done[(L, R)] = score

for score in scores:
    print(score)



### FIXED CODE ###

import numpy as np

H, W, D = [int(x) for x in input().strip().split(' ')]
stage = {}
for i in range(H):
    nums = [int(x) for x in input().strip().split(' ')]
    for j in range(W):
        stage[nums[j]] = [i + 1, j + 1]
Q = int(input())
tests = []
for _ in range(Q):
    tests.append([int(x) for x in input().strip().split(' ')])

scores = np.zeros([H * W + 1]).astype(np.int)
for i in range(H * W, 0, -1):
    if i + D > H * W:
        scores[i] = 0
    else:
        x, y = stage[i]
        ox, oy = stage[i + D]
        scores[i] = scores[i + D] + abs(x - ox) + abs(y - oy)

for i in range(Q):
    L, R = tests[i]
    print(scores[L] - scores[R])
a,b=map(int,input().split())
prnit((a-0.01)//(2*b+1)+1)

### FIXED CODE ###

a,b=map(int,input().split())
print(int((a-0.01)//(2*b+1)+1))
import math

N = int(input())
A = list(map(int,input().split()))
B  = [math.log10(x) for x in A]

ans = 1
if sum(B) > 18:
    ans = -1
else:
    for a in A:
        ans *= a

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

### FIXED CODE ###


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

t = 1
ans = 1
count = 0

if 0 in A:
    ans = 0
else:  
    for a in A:
        ans *= a
        t *= a
        while t >= 10:
            t /= 10
            count += 1
            if count >= 19:
                ans = -1 
                break

if ans > 10**18:
    print(-1)
else:
    print(ans)
from sys import stdin
readline = stdin.buffer.readline

import numpy as np
from numba import jit
# stdin = open('sample.txt')

@jit(cache=True)
def main():
    H, W, M = map(int, readline().rstrip().split())
    HW = np.zeros((H + 1, W + 1), np.int64)
    HB = np.zeros((H + 1), np.int64)
    HS = set()
    WB = np.zeros((W + 1), np.int64)
    WS = set()
    for _ in range(M):
        h, w = map(int, readline().rstrip().split())
        HW[h, w] = 1
        HB[h] += 1
        HS.add(h)
        WB[w] += 1
        WS.add(w)
    ans = 0
    for h in HS:
        for w in WS:
            tmp = HB[h] + WB[w]
            if HW[h, w] == 1:
                tmp -= 1
            ans = max(ans, tmp)
    print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    from collections import defaultdict
    readline = sys.stdin.readline

    H, W, M = map(int, readline().rstrip().split())
    HB = [0] * H
    WB = [0] * W
    HW = defaultdict(lambda : False)
    for _ in range(M):
        h, w = map(int, readline().rstrip().split())
        h -= 1
        w -= 1
        HW[(h,w)] = True
        HB[h] += 1
        WB[w] += 1
    hb = max(HB)
    max_h = [i for i, x in enumerate(HB) if x == hb]
    wb = max(WB)
    max_w = [i for i, x in enumerate(WB) if x == wb]
    
    ans = hb + wb
    for mh in max_h:
        for mw in max_w:
            if HW[(mh, mw)] == False:
                print(ans)
                sys.exit(0)
    print(ans - 1)

if __name__ == "__main__":
    main()
from collections import deque 

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

for i in range(N):
    remA=A.popleft()
    print(max(A))
    A.append(remA)


### FIXED CODE ###

r = input()
Ans=3*int(r)**2

print(Ans)
a, b =map(int, input().split())
print(a*b, 2*(a+b))



### FIXED CODE ###

a, b =map(int, input().split())
print(a*b, 2*(a+b))
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 1000000007

zero_flag = False

last_ana = int(input())
blocks = [last_ana]

for _ in range(1, m):
    ana = int(input())
    blocks.append(ana - last_ana - 1)
    last_ana = ana

blocks.append(n - last_ana)

if 0 in blocks:
    ans = 0
else:
    ans = 1
    for num in blocks:
        if num == 1:
            continue
        k = num // 2
        m = num % 2
        cases = 3 * k - 2 + m
        ans *= cases
        # if ans >= BIGNUM:
        #     ans %= BIGNUM

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

if m > 0:
    last_ana = int(input())
    blocks = [last_ana]

    for _ in range(1, m):
        ana = int(input())
        blocks.append(ana - last_ana - 1)
        last_ana = ana
    blocks.append(n - last_ana)
else:
    blocks = [n + 1]

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)
    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)
def flip(B, m, n, M, N):
#  print(m,n)
  for mm in range(m-1,m+2):
    for nn in range(n-1,n+2):
#      print("mm=", mm, "nn=", nn)
      if 0<=mm and mm<M and 0<=nn and nn<N:
        if B[mm][nn] == 0:
          B[mm][nn] = 1
        else:
          B[mm][nn] = 0
#print(input().split())
MN=list(map(int, input().split()))
B = [[0 for i in range(MN[0])] for j in range(MN[1])]
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    flip(B, m, n, MN[0], MN[1])
c = 0
for m in range(0,MN[0]):
  for n in range(0,MN[1]):
    c += B[m][n]
#print(B)
print(c)

### FIXED CODE ###

MN=list(map(int, input().split()))
M = MN[0]
N = MN[1]
if N == 1:
  N = MN[0]
  M = MN[1]
if M == 1:
  if N == 1:
    c = 1
  elif N == 2:
    c = 0
  else:
    c = N - 2
else:
  c = (M - 2)*(N - 2)
print(c)
def fizzbuzz(n):
	if n%15==0: return "FizzBuzz"
	if n%5==0: return "Buzz"
	if n%3==0: return "Fizz"
	return str(n)

while 1:
	m,n=map(int,raw_input().split())
	if m==0:break
	player=range(1,m+1)
	for i in range(n):
		if len(player)>1:
			if fizzbuzz(i+1)!=raw_input():
				player.pop((i-(m-len(player)))%len(player))
	print " ".join(map(str,player))

### FIXED CODE ###

def fizzbuzz(n):
	if n%15==0: return "FizzBuzz"
	if n%3==0: return "Fizz"
	if n%5==0: return "Buzz"
	return str(n)
while 1:
	try:
		m,n=map(int,raw_input().split())
		if m==0:break
		player=range(1,m+1)
		p=0
		for i in range(n):
			if fizzbuzz(i+1)!=raw_input():
				del player[p]
				m=len(player)
				if m==1:
					break
				p%=m
			else:
				p=(p+1)%m
		print " ".join(map(str,player))
	except:
		pass
n = int(input())
a = []
edge = [[] for _ in range(n)]
visited = [0] * n

def dfs(n):
    visited[n] = 1
    if len(edge[n]) == 1 and n != 0:
        return 0
    childrank = []
    for item in edge[n]:
        if visited[item] == 1:
            continue
        childrank.append(dfs(item))
    childrank.sort(reverse=True)
    for i in range(len(childrank)):
        childrank[i] += i + 1
    return max(childrank)


for i in range(1, n):
    val = int(input()) - 1
    edge[i].append(val)
    edge[val].append(i)

print(dfs(0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n = int(input())
a = []
edge = [[] for _ in range(n)]
visited = [0] * n

def dfs(n):
    visited[n] = 1
    if len(edge[n]) == 1 and n != 0:
        return 0
    childrank = []
    for item in edge[n]:
        if visited[item] == 1:
            continue
        childrank.append(dfs(item))
    childrank.sort(reverse=True)
    for i in range(len(childrank)):
        childrank[i] += i + 1
    return max(childrank)


for i in range(1, n):
    val = int(input()) - 1
    edge[i].append(val)
    edge[val].append(i)

print(dfs(0))
n = int)input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in l:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)

### FIXED CODE ###

n = int(input())
xs = []
for i in range(n): xs.append(input())
m = int(input())
flag = 1
for i in range(m):
    s = input()
    if s in xs:
        print("Opened" if flag == 1 else "Closed", "by", s)
        flag ^= 1
    else:
        print("Unknown", s)
N,M,X = map(int,input().split())
li = []
import numpy as np
C = []

for _ in range(N):
    c,*a = map(int,input().split())
    li.append(np.array(a))
    C.append(c)

counter = []

for i in range(1<<N):
    skill_li = np.zeros(M).astype(int)
    sum_price = 0
    for k in range(N):
        if (i>>k) & 1:
            skill_li += li[k]
            sum_price += C[k]
    if all(skill_li>=X):
        counter.append(sum_price)

if len(counter)==0:
    print(-1)
else:
    print(min(counter))

### FIXED CODE ###

N,M,X = map(int,input().split())
li = []
import numpy as np
C = []

for _ in range(N):
    c,*a = map(int,input().split())
    li.append(np.array(a))
    C.append(c)

counter = []

for i in range(1<<N):
    skill_li = np.zeros(M).astype(int)
    sum_price = 0
    for k in range(N):
        if (i>>k) & 1:
            skill_li += li[k]
            sum_price += C[k]
    if all(skill_li>=X):
        counter.append(sum_price)

if len(counter)==0:
    print(-1)
else:
    print(min(counter))
a,b,m=map(int, input().split())
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m
ans = []
for i in range(m):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])
for i in range(b):
	for j in range(a):
		ans.append(rei[j]+den[i]

### FIXED CODE ###

m=list(map(int, input().split()))
rei=list(map(int, input().split())) 
den=list(map(int, input().split())) 
cou = [0] * m[2]
ans = []
for i in range(m[2]):
	cou[i]=list(map(int, input().split()))
	ans.append(rei[cou[i][0]-1]+den[cou[i][1]-1]-cou[i][2])

ans.append(min(rei)+min(den))
print(min(ans))
N,C = map(int,input().split())
X,V = [],[]
for i in range(N):
    x,v = map(int,input().split())
    X.append(x)
    V.append(v)
Xa,Xb = [X[0]]+[0]*(N-1),[0]*(N-1)+[C-X[N-1]]
for i in range(1,N):
    Xa[i] = X[i] - X[i-1]
for i in range(N-1):
    Xb[N-2-i] = X[N-1-i] - X[N-2-i]

Point1,Point2 = [],[]
point = 0
for i in range(N):
    point = point - Xa[i] + V[i]
    Point1.append(point)
point = 0
for i in range(N):
    point = point - Xb[N-1-i] + V[N-1-i]
    Point2.append(point)

#順方向に食べ続けていく場合に、何個目で過去最高を更新するか
N1,N2 = [],[]
if Point1[0] > Point1[1]:
    N1.append(0)
for i in range(1,N-1):
    if Point1[i+1] < Point1[i] and Point1[i-1] < Point1[i]:
        N1.append(i)
if Point1[N-1] == max(Point1):
    N1.append(N-1)
#逆方向に食べ続けていく場合に、何個目で過去最高を更新するか
if Point2[0] > Point2[1]:
    N2.append(0)
for i in range(1,N-1):
    if Point2[i+1] < Point2[i] and Point2[i-1] < Point2[i]:
        N2.append(i)
if Point2[N-1] == max(Point2):
    N2.append(N-1)

Ans = 0
#順方向に食べ、逆方向に最大限まで食べる
for i in N1:
    #順方向に食べて停止した時点のポイント
    point = Point1[i]
    Ans = max(Ans,point)
    #0まで戻るのに必要なポイント
    point -= X[i]
    #逆方向にどこまで食べられるか
    for j in N2:
        if j < N-1-i:
            point += Point2[j]
            Ans = max(Ans,point)

#逆方向に食べ、順方向に・・・
for i in N2:
    point = Point2[i]
    Ans = max(Ans,point)
    #0まで戻るのに必要なポイント
    point -= (C - X[N-1-i])
    for j in N1:
        #
        if j < N-1-i:
            point += Point1[j]
            Ans = max(Ans,point)

#出力
print(Ans)



    

### FIXED CODE ###

N,C = map(int,input().split())
X,V = [],[]
for i in range(N):
    x,v = map(int,input().split())
    X.append(x)
    V.append(v)
Ans = 0

# 右回り、左周りの原点基準の移動距離
xR = [0]+X
xL = [0]+list(map(lambda x: C-x,reversed(X)))

# 右回り,左周りで食べた時の累積カロリー
V2 = list(reversed(V))
calR,calL = [0],[0]
for i in range(N):
    calR.append(calR[i]+V[i])
    calL.append(calL[i]+V2[i])

# 移動距離を考慮した獲得カロリー
getR,getL = [],[]
for i in range(N+1):
    getR.append(calR[i]-xR[i])
    getL.append(calL[i]-xL[i])
# 単調増加になるように修正
for i in range(N):
    if getR[i+1] < getR[i]:
        getR[i+1] = getR[i]
    if getL[i+1] < getL[i]:
        getL[i+1] = getL[i]

for i in range(N+1):
    gr = getR[N-i]
    gl = getL[i]
    xr = xR[N-i]
    xl = xL[i]
    # 右回り → 左周り
    Ans = max(Ans, gr, gr-xr+gl)
    # 左周り → 右回り
    Ans = max(Ans, gl, gl-xl+gr)

print(Ans)
r = int(input())
l = int(input())
print((r-1)*(l-1))

### FIXED CODE ###

n,m = map(int,input().split())
print((n-1)*(m-1))
def main():
    n, a, b = map(int, input().split())

    if (b-a) % 2 == 1:
        t = min(a-1, n-b)
        if a-1 == t:
            a = 1
            b = b-t
            print(t + 1 + ((b-1)-a)//2)
        else:
            a = a + t
            b = n
            print(t + 1 ((b-1)-a)//2)

    else:
        print((b-a)//2)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = 10**18
    a = 10**18
    b = 10**18
    n, a, b = map(int, input().split())

    if (b - a) % 2 == 1:
        print((b-a)//2 + (b-a) % 2 + min(a-1, n-b))
    else:
        print((b - a) // 2)


if __name__ == '__main__':
    main()
n = input()

for i in range(n):
    a = input(),
    b = input()
    print a + b

### FIXED CODE ###

n = input()

for i in range(n):
    a = input()
    b = input()
    c = int(a) + int(b)
    if len(str(c)) > 80:
        print 'overflow'
    else:
        print a + b
N = int(input())

count = 0

for i in range(N):
	num = int(input())
    if num % 3 == 0 and num % 5 == 0:
    	continue
    elif num % 3 == 0:
    	continue
    elif num % 5 == 0:
    	continue
    else:
    	count += num

print(count)

### FIXED CODE ###

n = int(input())

list = []

count = 1

for i in range(n):
  if count % 3 != 0 and count % 5 != 0:
    list.append(count)
  count += 1
    
print(sum(list))
print(int(input())**3))

### FIXED CODE ###

print(int(input())**3)
;


### FIXED CODE ###

x = input()
a,b,c,d,e = map(int,x.split())
print(15 - a-b-c-d-e)