Harryxun/stf_run huggingface dataset:
def ABC_77_A():
    A,B,C = map(str, input().split())
    A2,B2,C2 = map(str, input().split())
    
    if A == C2 and C == A2 and B == B2:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_77_A()

### FIXED CODE ###

def ABC_77_A():
    C1= input()
    C2 =input()
    
    if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':

    ABC_77_A()
import.math
A, B = map(int, input().split())
ans = (A*B)
print(int(ans))

### FIXED CODE ###

def resolve():
    A, B = input().split()
    ans = int(A)*int(B[0])*100+int(A)*int(B[2:])
    print(str(ans)[:-2] if len(str(ans)) >= 3 else "0")
resolve()
n, m = map(int, input().split()) 
card = list(map(int, input().split()))
card.sort()
command = [list(map(int, input().split())) for i in range(m)]
command.sort(key=lambda x: x[1], reverse=True)

ind = 0
maxNum = len(card)
for i in command:
    for j in range(i[0]):
        if maxNum < ind:
            break
        if card[ind] >= i[1]:
            break
        card[ind] = i[1]
        ind += 1
    else:
        continue
    break
print(sum(card))

### FIXED CODE ###

n, m = map(int, input().split()) 
card = list(map(int, input().split()))
card.sort()
command = [list(map(int, input().split())) for i in range(m)]
command.sort(key=lambda x: x[1], reverse=True)

ind = 0
maxNum = len(card)
for i in command:
    for j in range(i[0]):
        if maxNum < ind+1:
            break
        if card[ind] >= i[1]:
            break
        card[ind] = i[1]
        ind += 1
    else:
        continue
    break
print(sum(card))
l = []
for i in range(int(input())):
  s,p = map(str, input().split())
  l.append((s,100-int(p),i+1))
m = sorted(l)
for i in l:
  print(l[2])

### FIXED CODE ###

l = []
for i in range(int(input())):
  s,p = map(str, input().split())
  l.append((s,100-int(p),i+1))
m = sorted(l)
for i in m:
  print(i[2])
n, k = map(int, input().split())
v = list(map(int, input().split()))
maxvalue = 0
for l in range(k+1):
    r = k - l
    leftmax = 0 
    for take in range(l+1):
        ava = sorted(v[:take])
        value = sum(ava)
        for back in range(min(take, l - take, n)):
            if ava[back] >= 0:
                break
            else:
                value -= ava[back]
        leftmax = max(leftmax, value)
    rightmax = 0
    for take in range(r+1):
        ava = sorted(v[n-take:])
        value = sum(ava)
        for back in range(min(take, r - take, n)):
            if ava[back] >= 0:
                break
            else:
                value -= ava[back]
        rightmax = max(rightmax, value)
    maxvalue = max(maxvalue, leftmax + rightmax)
print(maxvalue)

### FIXED CODE ###

n, k = map(int, input().split())
v = list(map(int, input().split()))
maxvalue = 0
for l in range(n+1):
    for r in range(l, n+1):
        ava = sorted(v[:l] + v[r:])
        takeop = len(ava)
        if takeop <= k:
            value = sum(ava)
            for i in range(min(takeop, k - takeop)):
                if ava[i] >= 0:
                    break
                else:
                    value -= ava[i]
            maxvalue = max(maxvalue, value)
print(maxvalue)
S = input()
s_i = 0
Q = int(input())
for _ in range(Q):
  T = input().split()
  if T[0]=="1":
    S = S[::-1]
  else:
	if T[1]=="1":
      S = T[2]+S
    else:
      S = S+T[2]
print(S)
	
      
    

### FIXED CODE ###

from collections import deque

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

t = deque(S)
reverse = False
for _ in range(Q):
    query = input()
    if query[0] == '1':
        reverse = not reverse
    elif query[0] == '2':
        _, F, C = query.split()
        if F == '1':
            if reverse:
                t.append(C)
            else:
                t.appendleft(C)
        elif F == '2':
            if reverse:
                t.appendleft(C)
            else:
                t.append(C)
result = ''.join(t)
if reverse:
    result = result[::-1]
print(result)
n=int(input())
ans += 1000*(n//500)
n=n%500
ans += n//5
print(ans)

### FIXED CODE ###

n=int(input())
ans = 1000*(n//500)
n=n%500
ans += 5*(n//5)
print(ans)
N,Q = map(int,input().split())
aLst = [[int(x) for x in input().split()] for _ in range(N-1)]
pLst = [[int(x) for x in input().split()] for _ in range(Q)]

tmpLst = [[] for _ in range(N+1)]
for i, j in aLst:
    tmpLst[i].append(j)
    tmpLst[j].append(i)

ansLst = [0] * (N + 1)
for i,j in pLst:
    ansLst[i] += j

def dfs(v, p, ansLst):
    for i in tmpLst[v]:
        if i == p:
            continue
        ansLst[i] += ansLst[v]
        dfs(i, v, ansLst)


dfs(1, 0, ansLst)

ans = ' '.join(map(str, ansLst[1:]))
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
q = [(1,0)]
while q:
    x,parent = q.pop()
    value[x] += value[parent]
    for y in graph[x]:
        if y == parent:
            continue
        q.append((y,x))

answer = ' '.join(map(str,value[1:]))
print(answer)
n, k = map(int, input().split())
C = [[1], [1,1]]
for i in range(2, n):
  C.append([1])
  for j in range(1, i):
    C[i].append(C[i-1, j-1] + C[i-1, j])
for i in range(1, k+1):
  print(C[n-k+1][i] * C[k-1,i-1])
  

### FIXED CODE ###

n, k = map(int, input().split())
mod = 10**9+7
C = [[1], [1,1]]
for i in range(2, n+10):
  C.append([1] + [(C[i-1][j-1] + C[i-1][j])%mod for j in range(1, i)] + [1])
for i in range(1, k+1):
  if n-k+1 < i or k < i:
    print(0)
  else:
    print((C[n-k+1][i] * C[k-1][i-1])%mod)
a, b =[int(x) for x in input().split()]

import numpy as np

n=a*b

A = np.array(a)
B = np.array(b)
if np.gcd(A, B) == 1:
  print(n)

elif a > b:
  for i in range(a, n+1):
    if (i%a == 0)and(i%b == 0):
      print(i)
      quit()
else:
  for i in range(b, n+1):
    if (i%a == 0)and(i%b == 0):
      print(i)
      quit()

### FIXED CODE ###

a, b = [int(x) for x in input().split()]
# a = [int(input()) for _ in range(m)]
# a = [int(x) for x in input().split()]

from fractions import gcd



print((a*b)//gcd(a, b))
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    ke="keyence"
    cunt=0
    cunt_str=0
    flag=False
    for i in range(len(s)):
        if s[i]==ke[cunt]:
            cunt+=1
            flag=False
        elif cunt_str==0 and flag==False:
            flag=True
            cunt_str+=1
        elif flag==False and cunt_str==1:
            print("NO")
            break
        print(i,s[i],flag)
    else:
        if cunt==7:print("YES")
        else:print("NO")

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    n=len(s)
    target="keyence"
    if s==target:
        print("YES")
        sys.exit()
    for i in range(n):#文字列開始
        for j in range(n):#文字列終了
            for k in range(i,j+1):
                #区間[i,j]が予想
                s_exp=s[:i]+s[j+1:]
                if s_exp==target:
                    print("YES")
                    sys.exit()
    print("NO")



if __name__=='__main__':
    main()
N, K = map(int, input().split())
list = [0]*N
for _ in range(K):
    d = int(input()) 
    l2= list(map(int, input().split()))
    print(l2)
    for val in l2:
        list[val-1] = 1
print(N-sum(list))

### FIXED CODE ###

N, K = map(int, input().split())
l1 = [0]*N
for _ in range(K):
    d = int(input()) 
    l2= list(map(int, input().split()))
    for val in l2:
        l1[val-1] = 1
print(N-sum(l1))
import sys
from collections import deque

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev == True:
                s.append(s)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev == True:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    s.reverse()
print(''.join(s))

### FIXED CODE ###

import sys
from collections import deque

# sys.stdin = open('test_cases/abc158d/in/01.txt', 'r')
# sys.stdin = open('input.txt', 'r')

s = deque([s for s in input()])
q = int(input())
rev = False

for query in sys.stdin:
    if query.strip() == '1': # sys.stdin does not remove line breaks. (vs. input() removes line breaks)
        if rev:
            rev = False
        else:
            rev = True
    else:
        t,f,c = query.split()
        if f == '1':
            if rev:
                s.append(c)
            else:
                s.appendleft(c)
        elif f == '2':
            if rev:
                s.appendleft(c)
            else:
                s.append(c)
if rev == True:
    s.reverse()
print(''.join(s))
N = input()
numN = int(N)
S =0
for i in range(len(N)):
    S += int(N[i])

if nunN % S == 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

S = input()
res = 0
for i in range(4):
    if S[i] == '+':
        res += 1
    else:
        res -= 1
print(res)
#ABC167B
a,b,c,d,k = map(int,input().split())
print(min(a,k)-max(k-a-b,0))

### FIXED CODE ###

#ABC167B
a,b,c,k = map(int,input().split())
print(min(a,k)-max(k-a-b,0))
import sys



def check_number(p,numbers):
  for plis in p:
    if plis == numbers:
      return 1
  return 0


X,N = map(int,input().split())
p = list(map(int,input().split()))

if N == 0:
  print( X )
  sys.exit()


after_ans = X
i = 100


for i in range(X+1,101,1):#前半
  if check_number(p,i) == 0:
    after_ans = i
    after_abs = abs(X-i)
    break

for i in range(X-1,-1,-1):#後半
  if check_number(p,i) == 0:
    before_ans = i
    before_abs = abs(X-i)
    break

if abs(after_abs) == abs(before_abs):
  answer = before_ans
elif abs(after_abs) > abs(before_abs):
  answer = before_ans
else:
  answer = after_ans

print( answer )


### FIXED CODE ###

import sys



def check_number(p,numbers):
  for plis in p:
    if plis == numbers:
      return 1
  return 0


X,N = map(int,input().split())
p = list(map(int,input().split()))

if N == 0:
  print( X )
  sys.exit()


after_ans = X
i = 100


for i in range(X,X+100,1):#前半
  if check_number(p,i) == 0:
    after_ans = i
    after_abs = abs(X-i)
    break

for i in range(X,X-100,-1):#後半
  if check_number(p,i) == 0:
    before_ans = i
    before_abs = abs(X-i)
    break

if abs(after_abs) == abs(before_abs):
  answer = before_ans
elif abs(after_abs) > abs(before_abs):
  answer = before_ans
else:
  answer = after_ans

print( answer )
n = int(input())
a = list(map(int, input().split()))
q = int(input())
aa = [0 for i in range(10 ** 5)]
for j in a:
    aa[j] += 1
suma = sum(a)
for f in range(q):
    b, c = map(int, input().split())
    suma += (c-b) * aa[b]
    aa[c] += aa[b]
    aa[b] = 0
    print(suma)
    

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for i in range(q)]
l = [0] * 100000
suml = 0
for i in a:
  l[i-1] += 1
  suml += i
for i in bc:
  suml += l[i[0]-1] * (i[1] - i[0])
  l[i[1]-1] += l[i[0]-1]
  l[i[0]-1] = 0
  print(suml)
import sys
h,w,m = map(int,input().split())
h_lst = [0]*h
w_lst = [0]*w
memo = []

for i in range(m):
  x,y = map(int,input().split())
  h_lst[x-1] += 1
  w_lst[y-1] += 1
  memo.append((x-1,y-1))

sh = 0
for i in range(h):
  if h_lst[i] > sh:
    sh = h_lst[i]
sw = 0
for i in range(h):
  if h_lst[i] > sw:
    sw = w_lst[i]



memo = set(memo)
              

for i in range(h):
  if h_lst[i] == sh:
    for j in range(w):
      if (i,j) not in memo and w_lst[j] == sw:
        print(sh+sw)
        sys.exit()
print((sh+sw)-1)        
  

### FIXED CODE ###

import sys
h,w,m = map(int,input().split())
h_lst = [[0,i] for i in range(h)]
w_lst = [[0,i] for i in range(w)]
memo = []

for i in range(m):
  x,y = map(int,input().split())
  h_lst[x-1][0] += 1
  w_lst[y-1][0] += 1
  memo.append((x-1,y-1))

h_lst.sort(reverse = True)
w_lst.sort(reverse = True)
Max_h = h_lst[0][0]
Max_w = w_lst[0][0]
h_ans = [h_lst[0][1]]
w_ans = [w_lst[0][1]]
if h != 1:
  s = 1
  while s < h and h_lst[s][0] == Max_h:
    h_ans.append(h_lst[s][1])
    s+= 1  
if w!= 1:  
  t=1  
  while t < w and w_lst[t][0] == Max_w:
    w_ans.append(w_lst[t][1])
    t += 1
  

memo = set(memo)

#探索するリストは、最大を取るものの集合でなければ計算量はO(m)にはならない！             
for j in h_ans:
  for k in w_ans:
    if (j,k) not in memo:
      print(Max_h+Max_w)
      sys.exit()
print((Max_h+Max_w)-1)
S = input()
Q = int(input())
Q_list = list()
for i in range(Q):
    Q_list.append(input().split())
 
from collections import deque
def operate(i):
    global count, str_list
    if Q_list[i][0] == '1':
        count += 1
    else:
        if count % 2 == 0:
            if Q_list[i][1] == '1':
                str_list.appendleft(Q_list[i][2])
            else:
                str_list.append(Q_list[i][2])
        else:
            if Q_list[i][1] == '1':
                str_list.append(Q_list[i][2])
            else:
                str_list.appendleft(Q_list[i][2])
 
check = 0
for i in range(Q):
    if Q_list[i][0] == '1':
        check += 1
 
if check % 2 == 1:
    S_list = list(reversed(S_list))
 
str_list = deque()
str_list.append(S)
count = check%2
for i in range(Q):
    operate(i)
print(''.join(str_list))

### FIXED CODE ###

S = input()
Q = int(input())
Q_list = list()
for i in range(Q):
    Q_list.append(input().split())

from collections import deque
def operate(i):
    global count, str_list
    if Q_list[i][0] == '1':
        count += 1
    else:
        if count % 2 == 0:
            if Q_list[i][1] == '1':
                str_list.appendleft(Q_list[i][2])
            else:
                str_list.append(Q_list[i][2])
        else:
            if Q_list[i][1] == '1':
                str_list.append(Q_list[i][2])
            else:
                str_list.appendleft(Q_list[i][2])

check = 0
for i in range(Q):
    if Q_list[i][0] == '1':
        check += 1

S_list = [i for i in S]
if check % 2 == 1:
    S_list = list(reversed(S_list))

S_n = ''.join(S_list)

str_list = deque()
str_list.append(S_n)
count = check%2
for i in range(Q):
    operate(i)
print(''.join(str_list))
n, m = list(map(int, input().split()))
if n>=3 and m>=3:
    print((n-2)*(m-2))
elif n == 1 or m == 1:
    print(n*m-2)
elif :
    print(0)

### FIXED CODE ###

n, m = list(map(int, input().split()))
if n == 2 or m == 2:
    print(0)
elif n == 1 or m == 1:
    print(max(1,n*m-2))
else:
    print((n-2)*(m-2))
# | Its_Rashid | #
n = int(input())
if n == 1 :
    print('Hello World')
else :
    print(sum([int(input()) for i in range()]))

### FIXED CODE ###

# | Its_Rashid | #
n = int(input())
if n == 1 :
    print('Hello World')
else :
    a = int(input())
    b = int(input())
    print(a + b)
if __name__ == '__main__':
    mod = 10**9 +7
    N = int(input())
    S = str(input())
    
    letter = defaultdict(int)
    for i in range(N):
        letter[S[i]] += 1
    count = 1
    for c in letter:
        count *= (letter[c]+1)
        count%mod
    print(count-1)

### FIXED CODE ###

from collections import defaultdict
if __name__ == '__main__':
    mod = 10**9 +7
    N = int(input())
    S = str(input())
    
    letter = defaultdict(int)
    for i in range(N):
        letter[S[i]] += 1
    count = 1
    for c in letter:
        count *= (letter[c]+1)
        count %= mod
    print(count-1)
n=int(input())
a=[list(map(int,input().split())) for i in range(2)]
sm = [sum(a[0])+a[1][n-1]]
for i in range(n-1):
  sm.append(sm[-1]-a[-i-1][0]+a[-i-2][1])
print(max(sm))

### FIXED CODE ###

n=int(input())
a=[list(map(int,input().split())) for i in range(2)]
sm = [sum(a[0])+a[1][n-1]]
for i in range(n-1):
  sm.append(sm[-1]-a[0][-i-1]+a[1][-i-2])
print(max(sm))
str=input()

a=str[0]
b=str[len(str)-1]
c=len(str)-2

print(a+str(c)+b)



### FIXED CODE ###

s=input()

a=s[0]
b=s[len(s)-1]
c=len(s)-2

print(a+str(c)+b)
n= (int(i) for i in input().split())
n.sort()
if n[0]+n[1]==n[2]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n=list(int(i) for i in input().split())
n.sort()
if n[0]+n[1]==n[2]:
    print("Yes")
else:
    print("No")
X,Y = map(input().split()) #input number of animals and legs

crane_legs = 2
turtle_legs = 4

answer = "No"

for i in range(X+1): #X+1 because it will only consider 0,1,2
    remaining=X-i #
    if crane_legs*i + turtle_legs*remaining == Y:
        answer = "Yes"
#Loop to check combinations of animals is correct

print(answer)

### FIXED CODE ###

#getting input from user
#cranes and turtle already give the information
#condition yes or no 
X,Y= map(int,input().split())
cranes= 2 # assign 2 to cranes
turtles= 4 # assign 4 to turtle
ans="No"
for i in range(X+1): 
    b=X-i
    if cranes*i + turtles*b == Y:
        ans = "Yes"
print(ans)

# Time complixity O(X)
a,b = map(int, input().split())

p = [1]*a

while True:
  if !input():
    break
  c = input().split()
  for d in c:
    p[d]=0

print(sum(p))

### FIXED CODE ###

a,b = map(int, input().split())
 
p = [1]*a
 
while True:
  try:
    input()
  except EOFError:
    break
  c = input().split()
  for d in c:
    p[int(d)-1]=0
 
print(sum(p))
N, Z, W = map(int,input().split())
p = list(map(int,input().split()))
a = abs(p[1] - p[2])
b = abs(p[2] - W)
print(max(a, b))

### FIXED CODE ###

N, Z, W = map(int,input().split())
p = list(map(int,input().split()))
a = abs(p[N-2] - p[N-1])
b = abs(p[N-1] - W)
print(max(a, b))
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(k):
  b=[0]*n
  cnt=0
  for j in range(n):
    if a[j]>=max(n-j,j)
    cnt+=1
  if cnt==n:
    for i in j in range(n):
      a[j]=(k-i)*n
    break
  for j in range(n):
    for m in range(j-a[j],j+a[j]+1):
      if 0<=m<=n-1:
        b[m]=b[m]+1
  a=b
for i in a:
  print(i,end=' ')

### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
for _ in range(min(k,41)):
  b=[0]*(n+1)
  for i in range(n):
    l=max(0,i-a[i])
    r=min(n,i+a[i]+1)
    b[l]+=1
    b[r]-=1
  for i in range(n-1):
    b[i+1]+=b[i]
  a=b[:n]
print(*a)
import pandas as pd

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    dict_s=dict()
    dict_s["s"]=s
    df_s = pd.DataFrame(dict_s)

    df_s_grp = df_s.groupby("s").size()
    
    max_size = df_s_grp.max()

    ans_list = df_s_grp[df_s_grp==max_size].index

    for i in range(len(ans_list)):
        print(str(ans_list[i]))

### FIXED CODE ###

from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])
N = int(input())
T = list(map(int,input().split()))
ans = sum(T)
M = int(input())
for i in range(M):
    P,X = map(int,input().split())
    t = A[P-1] - X
    print(ans-t)

### FIXED CODE ###

N = int(input())
T = list(map(int,input().split()))
ans = sum(T)
M = int(input())
for i in range(M):
    P,X = map(int,input().split())
    t = T[P-1] - X
    print(ans-t)
#coding:utf-8
n = int(input())
#切り上げ
x = int(-(-n // 1.08))

if x * 1.08 == n:
  print(x)
else:
  print(':(')



### FIXED CODE ###

#coding:utf-8
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if d2 == 1:
  print('1')
else:
  print('0')
x=int(input())
ans=0
for i in range(2,11):
  for j in range(x):
    if x-j**i>0 and j**i>ans:
      tmp=j**i
    else:
      break
  ans=[tmp,ans][tmp<ans]
print(ans)

### FIXED CODE ###

x=int(input())
ans=1
for b in range(1,x):
  for p in range(2,x):
    if x-b**p>=0:
      ans=max(ans,b**p)
    else:
      break
print(ans)
H, A = mat(int, input().split())

if H % A == 0:
  print(H / A)
  
elif H % A != 0:
  print(H / A +1)

### FIXED CODE ###

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

if H % A != 0:
  print(H//A + 1)
  
elif H % A == 0:
  print(H//A)
N = int(input())
h = [int(i) for i in input().split()]

memo = {}

def f(i):
  if i == 0:
    return 0
  if i == 1:
    return abs(h[i - 1] - h[i])
  else:
    if i - 1 not in memo:
      memo[i - 1] = f(i - 1)
    if i - 2 not in memo:
      memo[i - 2] = f(i - 2)
    j1 = memo[i - 1] + abs(h[i - 1] - h[i])
    j2 = memo[i - 2] + abs(h[i - 2] - h[i])
    return j1 if j1 < j2 else j2

print(f(N - 1))


### FIXED CODE ###

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

memo = []
for i in range(N):
  if i == 0:
    memo.append(0)
  elif i == 1:
    memo.append(memo[i - 1] + abs(h[i - 1] - h[i]))
  else:
    j1 = memo[i - 1] + abs(h[i - 1] - h[i])
    j2 = memo[i - 2] + abs(h[i - 2] - h[i])
    memo.append(j1 if j1 < j2 else j2)

print(memo[N - 1])
s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)

### FIXED CODE ###

s = input()
 
for i in range(len(s)):
    if s[i] == '?':
        if i == 0 and len(s) == 1:
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == 'D':
            s = s.replace('?','P',1)
        elif i == 0 and s[1] == 'P':
            s = s.replace('?','D',1)
        elif i == 0 and s[1] == '?':
            s = s.replace('?','D',1)
        elif s[i-1] =='P':
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i ==len(s)-1):
            s = s.replace('?','D',1)
        elif s[i-1] =='D' and (i <len(s)-1 and(s[i+1] == 'P' or s[i+1] == '?')):
            s = s.replace('?','D',1)
        else:
            s = s.replace('?','P',1)


print(s)
import numpy as np
N=int(input())
A=list(map(int,input().split())
B=np.array(A)
C=B**-1
print((C.sum())**-1)

### FIXED CODE ###

import numpy as np
N=int(input())
A=np.array(list(map(float,input().split())))

C=A**-1
#print(C)
print((C.sum())**-1)
A = int(input())
B = int(input())
array = (1,2,3)
array.remove(A,B)
print (array)

### FIXED CODE ###

a = int(input())
b = int(input())
print (6 - a - b)
#ABC141_C
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')
print(ans)
for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No') 

### FIXED CODE ###

#ABC141_C
import numpy as np
N,K,Q=map(int,input().split())
ans=(K-Q)*np.ones((1,N),dtype='int32')

for _ in range(Q):
    idx=int(input())
    ans[0,idx-1]+=1
ans=ans.tolist()[0]
for i in range(len(ans)):
    if ans[i]>0:
        print('Yes')
    else:
        print('No')
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

import math
print(ceil((N-1)/(K-1)))

### FIXED CODE ###

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

import math
print(math.ceil((N-1)/(K-1)))
n,d = map(int, input().split())

while True:
    a = n- i*(2*d+1)
    if a<=0:
        print(i)
        break
    else:
        continue


### FIXED CODE ###

n,d = map(int, input().split())
a = 0
ct=0

for i in range(n):
    if n<d:
        print(1)
        break
    else:
        a = n- i*(2*d+1)
        if a<=0:
            print(i)
            break