Harryxun/stf_run huggingface dataset:
listA=[]
listOP=[]
listB=[]
count=0
while True:
    a,op,b=input().split()
    listA.append(int(a))
    listOP.append(op)
    listB.append(int(b))
    if a=="0" and op=="?" and b=="0":
        del listA[len(listA)-1]
        del listOP[len(listOP)-1]
        del listB[len(listB)-1]
        break
#入力パートここまで。計算出力パートここから
while count<=len(listA)-1:
    if listOP[count]=="+":
        print(listA[count]+listB[count])
    elif listOP[count]=="-":
        print(listA[count]-listB[count])
    elif listOP[count]=="*":
        print(listA[count]*listB[count])
    elif listOP[count]=="/":
        print(listA[count]//listB[count])
    else:
        print("ERROR")
    count+=1


### FIXED CODE ###

listA=[]
listOP=[]
listB=[]
count=0
while True:
    a,op,b=input().split()
    listA.append(int(a))
    listOP.append(op)
    listB.append(int(b))
    if op=="?":
        del listA[len(listA)-1]
        del listOP[len(listOP)-1]
        del listB[len(listB)-1]
        break
#入力パートここまで。計算出力パートここから
while count<=len(listA)-1:
    if listOP[count]=="+":
        print(listA[count]+listB[count])
    elif listOP[count]=="-":
        print(listA[count]-listB[count])
    elif listOP[count]=="*":
        print(listA[count]*listB[count])
    elif listOP[count]=="/":
        print(listA[count]//listB[count])
    else:
        print("ERROR")
    count+=1
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 09:36:44 2017

@author: kotania
"""

N = int(input())
lrList = [""]*N
for n in range(0,N):
    lrList[n] = input()

sum = 0
for lr in lrList:
    sum += (int(lr.split()[1]) - int(lr.split()[0]) + 1)
    
print(sum)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Tue Dec 19 09:31:04 2017

@author: kotania
"""

N = input()

if int(N) > 89 :
    print("Yes")
elif N[1] == "9":
    print("Yes")
else :
    print("No")
def main():
    n, k = map(int, input().split())
    x = [int(i) for i in input().split()]

    n = []
    p = []
    ans = []
    for xi in x:
        if xi < 0:
            n.append(xi)
        else:
            p.append(xi)

    # print(n,p)

    # i: nから選ぶ個数
    # k-i: pから選ぶ個数
    for i in range(k):
        if i > len(n):
            continue
        if k-i > len(p):
            continue

        if i != 0:
          nd = -n[-i]
          pd = p[k-i-1]
          ans.append(nd + pd + min(nd, pd))
        else:
          ans.append(p[k-1])

    # print(ans)
    print(min(ans))







if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, k = map(int, input().split())
    x = [int(i) for i in input().split()]

    n = []
    p = []
    ans = []
    for xi in x:
        if xi < 0:
            n.append(xi)
        else:
            p.append(xi)

    # print(n,p)

    # i: nから選ぶ個数
    # k-i: pから選ぶ個数
    for i in range(k+1):
        # print(i, k-i, k)
        if i > len(n):
            continue
        if k-i > len(p):
            continue

        if i == 0:
            ans.append(p[k-1])
        elif k - i == 0:
            ans.append(-n[-k])
        else:
            nd = -n[-i]
            pd = p[k-i-1]
            ans.append(nd + pd + min(nd, pd))

    # print(ans)
    print(min(ans))


if __name__ == '__main__':
    main()
n = input()
ini = input()
ini_pri=input()
left_pri=input()

ans = 0
for i in range(n):
  	if i < ini:
      ans += ini_pri
    else:
      ans += left_pri

print(ans)

### FIXED CODE ###

a = [int(input()) for i in range(4)]
ans = 0

for i in range(1,a[0]+1):
  if i<=a[1]:
    ans += a[2]
  else:
    ans += a[3]

print(ans)
case = input()
case = array(case)
for i in range(len(case)):
  AC = 0
  WA = 0
  TLE = 0
  RE = 0
  others = 0
  if case[i] == "AC":
    AC += 1
    return AC
  elif case[i] == "WA":
    WA += 1
    return WA
  elif case[i] == "TLE":
    TLE += 1
    return TLE
  elif case[i] == "RE":
    RE += 1
    return RE
  else :
    others += 1
    return others
print("AC"+"x"+AC)
print("WA"+"x"+WA)
print("TLE"+"x"+TLE)
print("RE"+"x"+RE)

### FIXED CODE ###

N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
others = 0
for i in range(N):
  case = input()
  if case == "AC":
    AC += 1
      
  elif case == "WA":
    WA += 1
      
  elif case == "TLE":
    TLE += 1
      
  elif case == "RE":
    RE += 1
      
print("AC"+" x "+str(AC))
print("WA"+" x "+str(WA))
print("TLE"+" x "+str(TLE))
print("RE"+" x "+str(RE))
N = int(input())
S = str(input())

for i in range(len(S)):
    a = []
    S_former = S[:i]
    S_latter = S[i:]
    for sub1 in S_former:
        if sub1 in S_latter:
           a.append(1)
           S_former.replace(sub1,"")
    b = sum(a)

print(max(b))

### FIXED CODE ###

N = int(input())
S = input()

A = []

for i in range(1,N+1):
    ans = 0
    X = S[:i]
    Y = S[i:len(S)+1]
    L = []
    M = []
    for j in range(len(X)):
        L.append(X[j])
    for k in range(len(Y)):
        M.append(Y[k])
    LS = set(L)
    for l in LS:
         if l in M:
            ans += 1

    A.append(ans)

print(max(A))
import numpy as np

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

npdata = np.arange(10**5+1)

kosuu=np.zeros(10)
kosuumoto=kosuu
for i in range(N):
    a=A[i]
    kosuu[a]+=1
SUM=sum(A)

BC_list=[]

for i in range (Q):
    bc=list(map(int,input().split()))
    BC_list.append(bc)
S=SUM

for i in range(Q):
    b=BC_list[i][0]
    c=BC_list[i][1]
    minus=b*kosuu[b]
    kosuu[c]=kosuu[c]+kosuu[b]
    plus=c*kosuu[c]
    kosuu[b]=0
    S=S-minus+plus

    print(int(S))

    


### FIXED CODE ###


import numpy as np

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

npdata = np.arange(10**5+1)

kosuu=np.zeros(10**5+1)
kosuumoto=kosuu
for i in range(N):
    a=A[i]
    kosuu[a]+=1
SUM=sum(A)

BC_list=[]

for i in range (Q):
    bc=list(map(int,input().split()))
    BC_list.append(bc)
S=SUM
for i in range(Q):
    b=BC_list[i][0]
    c=BC_list[i][1]
    minus=b*kosuu[b]
    plus=c*kosuu[b]
    kosuu[c]=kosuu[c]+kosuu[b]
    kosuu[b]=0
    S=S-minus+plus
    print(int(S))
s = list(input())
if s[0] == s[1] and s[2] == s[3] and s[0] !== s[2]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = list(input())
s.sort()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print("Yes")
else:
  print("No")
n = int(input())

ans = 1
whille ans*2 <= n:
    ans *= 2
print(ans)

### FIXED CODE ###

n = int(input())

ans = 1

while ans*2 <= n:
    ans *= 2
print(ans)
n,m = map(int, input().split())
s = [list(map(int, input().split())) for i in range(m)]

count = float('inf')
if n == 3:
    for i in range(100, 1000):
        a = str(i)
        if int(a[s[0][0]-1]) == int(s[0][1]) and int(a[s[1][0]-1]) == int(s[1][1]) and int(a[s[2][0]-1]) == int(s[2][1]):
             if i < count:
                 count = i
elif n == 2:
    for i in range(10, 100):
        a = str(i)
        if int(a[s[0][0]-1]) == int(s[0][1]) and int(a[s[1][0]-1]) == int(s[1][1]):
            if i < count:
                count = i
elif n == 1:
    for i in range(0, 10):
        a = str(i)
        if int(a[s[0][0]-1]) == int(s[0][1]):
            if i < count:
                count = i

if count == float('inf'):
    print(-1)
else:
    print(count)


### FIXED CODE ###

n,m = map(int, input().split())
s = [list(map(int, input().split())) for i in range(m)]

count = float('inf')
if n == 3:
    for i in range(100, 1000):
        a = str(i)
        if all(int(a[s[j][0]-1]) == int(s[j][1]) for j in range(m)):
            if i < count:
                 count = i
elif n == 2:
    for i in range(10, 100):
        a = str(i)
        if all(int(a[s[j][0]-1]) == int(s[j][1]) for j in range(m)):
            if i < count:
                count = i
elif n == 1:
    for i in range(0, 10):
        a = str(i)
        if all(int(a[s[j][0]-1]) == int(s[j][1]) for j in range(m)):
            if i < count:
                count = i

if count == float('inf'):
    print(-1)
else:
    print(count)
import collections
N = int(input())
countr = []
liss = []
for i in range(N):
  s = input()
  a = collections.Counter(s)
  if a in liss:
    ind = liss.index(a)
    countr[ind] += 1
  else:
    liss.append(a)
    countr[len(liss)-1] = 1

ans = 0
for cc in countr:
  if cc > 1:
    ans = ans + cc * (cc - 1) / 2
print(ans)


### FIXED CODE ###

N = int(input())
liss = {}
for i in range(N):
  s = input()
  a = "".join(sorted(s))
  if a in liss:
    liss[a] += 1
  else:
    liss[a] = 1

ans = 0
for cc in liss:
  ans = ans + (liss[cc] * (liss[cc] - 1) / 2)
print(int(ans))
def move_func(dice_list, dir):
	new_dice = []
	if dir=="N":
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[4])
	elif dir=="E":
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[2])
	elif dir=="S":
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[1])
	elif dir=="W":
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[0])
	return new_dice

try:
	while True:
		dice_list = input().split(" ")
		move_cmd = input()
		for cmd in  move_cmd:
			dice_list = move_func(dice_list, cmd)
			
		print(dice_list[0])
except EOFError:
	pass

### FIXED CODE ###

#N E S W
def move_func(dice_list, dir):
	new_dice = []
	if dir=="N":
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[4])
	elif dir=="E":
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[2])
	elif dir=="S":
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[3])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[1])
	elif dir=="W":
		new_dice.append(dice_list[2])
		new_dice.append(dice_list[1])
		new_dice.append(dice_list[5])
		new_dice.append(dice_list[0])
		new_dice.append(dice_list[4])
		new_dice.append(dice_list[3])
	return new_dice

try:
	while True:
		dice_list = input().split(" ")
		move_cmd = input()
		for cmd in  move_cmd:
			dice_list = move_func(dice_list, cmd)
			
		print(dice_list[0])
except EOFError:
	pass
while True:
    calc = input()
    if calc == '0 ? 0':
        break
    print(eval(calc.replace("/","//")))

### FIXED CODE ###

while True:
    calc = input()
    if "?" in calc:
        break
    print(eval(calc.replace("/","//")))
import sys
my_list = []
max_list = []
len_line = int(sys.stdin.readline().strip())

for item in sys.stdin.read()[:-1]:
    my_list.append(int(item.strip()))

for i in range(1, len_line):
    max_list.append(my_list[i] - min(my_list[:i]))

print max(max_list)

### FIXED CODE ###

num = raw_input()
num_list = []
for i in range(int(num)):
    a = raw_input()
    num_list.append(int(a))

min_ans = num_list[0]
max_ans = float("-inf")
for i in num_list[1:]:
    if i - min_ans > max_ans:
        max_ans = i - min_ans
    if i < min_ans:
        min_ans = i

print max_ans
#!/usr/bin/env python
# -*- coding: utf-8 -*-

var = raw_input()

var = var^3
print var

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

var = int(raw_input())
sum = var*var*var

print sum
K = int(input())

if K%2 == 0:
	print ((K//2)**2)
else:
	print ((K//2)*((K//2)+1)


### FIXED CODE ###

k = int(input())

if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
S = input()
A = S.count('a')
B = S.count('b')
C = S.count('c')
if a == b == c == 1:
  print('Yes')
else
:
  print('No')

### FIXED CODE ###

S = input()
A = S.count('a')
B = S.count('b')
C = S.count('c')
if A == B == C == 1:
  print('Yes')
else:
  print('No')
print(a)


### FIXED CODE ###

a, b = map(int, input().split())
if a*b % 2 == 0:
  print("Even")
else:
  print("Odd")
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

### FIXED CODE ###

import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)
a,b,c=map(int,input().split())
if a==b and b=c and c=a:
  print(No)
elif a!=b and b!=c and c!=a:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b and b==c and c==a:
  print("No")
elif a!=b and b!=c and c!=a:
  print("No")
else:
  print("Yes")
N = int(input())
S = input().strip()

def tree(N,s,index):
  if N <= index:
      if len(s) > 0:
          return 1
      else:
          return 0

  if S[index] in s:
      return tree(N,s, index + 1)
  else:
      return tree(N,s, index + 1) + tree(N,s + S[index], index + 1)


print(tree(N,"",0) % 1000000007)




### FIXED CODE ###

N = int(input())
S = input()

words = {}

for s in S:
    if s in words.keys():
        words[s] += 1
    else:
        words[s] = 2

res = 1
for k in words.keys():
    res *= words[k]

print((res - 1) % 1000000007)
from functools import cmp_to_key
from heapq import heappush, heappop, heapify, heapreplace
n, m = map(int, input().split())
a = [int(e) for e in input().split()]
heapify(a)
bc = [[int(e) for e in input().split()] for _ in range(m)]
bc.sort(key = cmp_to_key(lambda x, y: x[1] - y[1]))
for i in range(m):
  b, c = bc[i]
  for j in range(b):
    if a[0] >= c:
      break
    else:
      heapreplace(a, c)
print(result)


### FIXED CODE ###

from functools import cmp_to_key
n, m = map(int, input().split())
a = [int(e) for e in input().split()]
bc = [[int(e) for e in input().split()] for _ in range(m)]
bc.sort(key = cmp_to_key(lambda x, y: y[1] - x[1]))
t = 0
for v in bc:
  b, c = v
  t += b
  a.extend([c] * b)
  if t > n:
    break
a.sort(reverse = True)
print(sum(a[:n]))
N=int(raw_input())
T=map(int,raw_input().split())
A=map(int,raw_input().split())

I,J=N-1,0
ans=1
for i in range(N):
    H=min(T[i],A[i])
    if i>0 and T[i-1]<T[i]:
        H=1
        if i+1 <N  and A[i+1]<A[i]:
            if T[i]!=A[i]:
                ans=0
                break
        if i==N-1 and T[i]!=A[i]:
            ans=0
            break
        if T[i] > A[i]
            ans=0
            break
    if i+1 <N and A[i+1] <A[i]:
        H=1
        if i==0 and T[i]!=A[i]:
            ans=0
            break
        if A[i] > T[i]
            ans=0
            break
    if i==0:
        H=1
        if T[i] > A[i]:
            ans =0
            break
    if i==N-1:
        H=1
        if A[i] > T[i]:
            ans = 0
            break
    ans *= H
    ans %= 1000000007
print ans

        



### FIXED CODE ###

N=int(raw_input())
T=map(int,raw_input().split())
A=map(int,raw_input().split())

I,J=N-1,0
ans=1
for i in range(N):
    H=min(T[i],A[i])
    if i>0 and T[i-1]<T[i]:
        H=1
        if i+1 <N  and A[i+1]<A[i]:
            if T[i]!=A[i]:
                ans=0
                break
        if i==N-1 and T[i]!=A[i]:
            ans=0
            break
        if T[i] > A[i]:
            ans=0
            break
    if i+1 <N and A[i+1] <A[i]:
        H=1
        if i==0 and T[i]!=A[i]:
            ans=0
            break
        if A[i] > T[i]:
            ans=0
            break
    if i==0:
        H=1
        if T[i] > A[i]:
            ans =0
            break
    if i==N-1:
        H=1
        if A[i] > T[i]:
            ans = 0
            break
    ans *= H
    ans %= 1000000007
print ans
def main():
    N, A, B = [int(i) for i in input().split()]
    diff = B - A
    if diff % 2 == 0:
        ans = diff // 2
    else:
        ans = min(B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 (diff - 1) // 2)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N, A, B = [int(i) for i in input().split()]
    diff = B - A
    if diff % 2 == 0:
        ans = diff // 2
    else:
        ans = min(B - 1, N - A, (A - 1) + 1 + (diff - 1) // 2, (N - B) + 1 + (diff - 1) // 2)
    print(ans)


if __name__ == '__main__':
    main()
N, K = map(int, input().split())
S = str(input())
L = [0]
for i in range(len(S)-1):
#     print(S[i],S[i+1])
    if S[i] != S[i+1]:
        L.append(i+1)
L.append(len(S))
# print(L)

ans = 1
if N > K * 3:
    for i in range(len(L)-K*2-1):
        ans = max(ans, L[i+K*3-1]-L[i])
    print(ans)
else:
    print(len(S))

### FIXED CODE ###

N, K = map(int, input().split())
S = list(str(input()))

count = 1
L = []
L.append(0)
for i in range(N):
    if i < N-1:
        if S[i] == S[i+1]:
            count += 1
        else:
            L.append(count)
            count = 1
    else:
        L.append(count)
        count = 1
L.append(0)

if S[0] == '1':
    ans = 0
    tmp = 0
    dist = 2 * (K + 1)
    for i in range(len(L)):
        tmp += L[i]
        if i % 2 == 1:
            if i - dist >= 0:
                tmp -= L[i-dist]
                tmp -= L[i-dist+1]
            ans = max(ans, tmp)
        else:
            if i == N - 1:
                ans = max(ans, tmp)
    print(ans)

if S[0] == '0':
    ans = 0
    tmp = 0
    dist = 2 * (K + 1)
    for i in range(len(L)):
        tmp += L[i]
        if i % 2 == 0:
            if i - dist + 1 >= 0:
                tmp -= L[i-dist+1]
            if i - dist >= 0:
                tmp -= L[i-dist]
            ans = max(ans, tmp)
        else:
            if i == N - 1:
                ans = max(ans, tmp)
    print(ans)
#解説参照
n = int(input())
a = list(map(int, input().split( )))

dp = 1
for i in range(n):
    dp |= dp<<a[i]
ans = (sum(a)+1)//2
tmp = 1<<sn
for i in range(ans):
    if dp&tmp:
        print(ans)
        exit()
    ans+=1
    tmp <<=1 
print(ans)

### FIXED CODE ###

#解説参照
n = int(input())
a = list(map(int, input().split( )))

dp = 1
for i in range(n):
    dp |= dp<<a[i]
ans = (sum(a)+1)//2
tmp = 1<<ans
for i in range(ans):
    if dp&tmp:
        print(ans)
        exit()
    ans+=1
    tmp <<=1
print(ans)
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
 
n = int(input())
M = [list(map(int, input().split())) for i in range(n)]
 
d = [INFTY for i in range(n)]
color = [INFTY for i in range(n)]
 
for i in range(n):
    u = int(input())
    k = int(input())
    for j in range(k):
        v = int(input())
        c = int(input())
        M[u][v] = c
        
def dijkstra():
    global M, d, p, color
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(n):
        if(d[i] = INFTY):
            d[i] == -1
            print(str(i) + " " + str(d[i]))
dijkstra()

### FIXED CODE ###

from sys import stdin

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(stdin.readline())
M = [[INFTY for i in range(n)] for j in range(n)]

for u in range(n):
    U = list(map(int, stdin.readline().split()[2:]))
    for j in range(0, len(U), 2):
        M[u][U[j]] = U[j+1]

d = [INFTY for i in range(n)]
color = [WHITE for i in range(n)]

def dijkstra():
    global n
    d[0] = 0
    color[0] = GRAY
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if(d[v] > d[u] + M[u][v]):
                    d[v] = d[u] + M[u][v]
                    color[v] = GRAY
    for i in range(
n):
        print(i, (-1 if d[i] == INFTY else d[i]))
dijkstra()
n = input()
A = list(map(int, input().split()))

nums = [0,0,0]
ans = 1
for a in A:
  ans = (ans*nums.count(a))%(10**9 +7)
  nums[nums.index(a)] +=1
print(ans)

### FIXED CODE ###

n = input()
A=[int(j) for j in input().split()]

nums = [0,0,0]
ans = 1
for a in A:
  ans = (ans*nums.count(a))%(10**9 +7)
  for i in range(len(nums)):
        if nums[i] == a:
            nums[i] = a+1
            break
          
print(ans)
s = list(input())
Pflag = False
Dflag = False
if s[0] == "?":
  if s[1] == "D":
      s[0] = "P"
  if s[1] == "P":
      s[0] = "D"
  if s[1] == "?":
      s[0] = "P"
      s[1] = "D"
for index, i in enumerate(s):
  if i == "?":
    if s[index-1] == "P":
      s[index] = "D"
    if s[index+1] == "D":
      s[index] = "P"
    if s[index+1] == "?":
      s[index] = "P"
      s[index+1] = "D"
ans = "".join(s)
print(ans)

    

    

### FIXED CODE ###

s = list(input())
for index, i in enumerate(s):
  if i == "?":
    s[index] = "D"
ans = "".join(s)
print(ans)
def main():
    S = input()
    T = input()
    count = 0
    for i in len(S):
        if S[i] != T[i]:
            count+=1
    print(count)


if __name__  == '__main__':
    main()

### FIXED CODE ###

S = input()
T = input()
C = 0
for i in range(len(S)):
  if S[i] == T[i]:
    pass
  else:
    C += 1
print(C)
n,c = map(int,input().split())
x = [0]
v = [0]
rf = [0] * (n+2)
rg = [0] * (n+2)
lf = [0] * (n+2)
lg = [0] * (n+2)
for i in range(0,n):
    X,V = map(int,input().split())
    x.append(X)
    v.append(V)
for i in range(0,n):
    rf[i+1] = rf[i] + v[i+1]
    rg[i+1] = max(rg[i],rf[i+1] - x[i+1])
for i in range(n+1,1,-1):
    lf[i-1] = lf[i] + v[i-1]
    lg[i-1] = max(lg[i],lf[i-1] - (c-x[i-1]))

#print(lg[::-1])
#print(rg)

for i in range(1,n):
    ans = max(ans,rg[i]+lg[i+1] - x[i],rg[i]+lg[i+1] - (c - x[i+1]))
print(ans)

### FIXED CODE ###

from itertools import*
from numpy import array
n,c=map(int,input().split())

l1=[]
l2=[]
for i in range(n):
    x,v=map(int,input().split())
    l1.append(x)
    l2.append(v)
#print(l1,l2)

ll=array([0]+l1)
lll=array([0]+list(accumulate(l2)))
lr=array([0]+[c-i for i in l1][::-1])
llr=array([0]+list(accumulate(l2[::-1])))
x=lll-ll
y=llr-lr
for i in range(1,n+1):
    x[i]=max(x[i-1],x[i])
    y[i]=max(y[i-1],y[i])
z=array([min(ll[::-1][i],lr[i])for i in range(n+1)])
print(max(x[::-1]+y-z))
lst = [input() for _ in range(5)]
check = float("inf")
last_num = 0

for i in lst:
    if int(i[-1]) != 0 and int(i[-1]) < check:
        check = int(i[-1])
        last_num = i

lst.remove(last_num)

for i in range(4):
    if int(lst[i]) % 10  != 0:
        lst[i] = (int(lst[i]) + (10 - int(lst[i]) % 10))

print(sum(list(map(int,lst))) + int(last_num))

### FIXED CODE ###

lst = [input() for _ in range(5)]
check = float("inf")
last_num = 0

for i in lst:
    if int(i[-1]) != 0 and int(i[-1]) < check:
        check = int(i[-1])
        last_num = i
if last_num != 0:
    lst.remove(last_num)

for i in range(len(lst)):
    if int(lst[i]) % 10  != 0:
        lst[i] = (int(lst[i]) + (10 - int(lst[i]) % 10))

print(sum(list(map(int,lst))) + int(last_num))