Harryxun/stf_run huggingface dataset:
n = int(input())
z = [list(map(int, input().split())) for _ in range(n)]
z.sort()
pq_pattern = []
pq_counter = [0]*(n-1)

for i in range(n-1):
    #print([z[i+1][0] - z[i][0], z[i+1][1] - z[i][1]])
    if [z[i+1][0] - z[i][0], z[i+1][1] - z[i][1]] in pq_pattern:
        pq_counter[pq_pattern.index([z[i+1][0] - z[i][0], z[i+1][1] - z[i][1]])] += 1
    else:
        pq_pattern.append([z[i+1][0] - z[i][0], z[i+1][1] - z[i][1]])
print(1+max(pq_counter))



### FIXED CODE ###

import sys
import collections
n = int(input())
z = [list(map(int, input().split())) for _ in range(n)]
z.sort()
pq_pattern = []
pq_counter = [1]*(n-1)*n

if n == 1:
    print(1)
    sys.exit()

for i in range(n):
    for j in range(n):
        if not i == j:
            if [z[j][0] - z[i][0], z[j][1] - z[i][1]] in pq_pattern:
                #print("YES!")
                pq_counter[pq_pattern.index([z[j][0] - z[i][0], z[j][1] - z[i][1]])] += 1
            else:
                pq_pattern.append([z[j][0] - z[i][0], z[j][1] - z[i][1]])
print(n-max(pq_counter))
a,b,c,d = map(int,input().split())
while a >= 0 or c >= 0:
    c =c - b
    a =a - d
if c <= 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S,W =map(int,input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
x,y = input().split(" ")
if x < y:
    print("<")
elif x > y:
    print(">")
else x == y:
    print("=")

### FIXED CODE ###

x,y = input().split(" ")
if x < y:
    print("<")
elif x > y:
    print(">")
else:
    print("=")
n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]
for i in range(len(L)):
    if L[i]%3 == 0 or L[i]%5== 0:
        flag = True
    else:
        flag =False
if flag:
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

n = int(input())
L = list(map(int,input().split()))
L = [x for x in L if x%2 ==0]

if all((L[i]%3 == 0 or L[i]%5 == 0 for i in range(len(L)))):

    print("APPROVED")
else:
    print("DENIED")
def nibun_right(a, x):
 lo, hi = 0, len(a)
 while lo < hi:
  mid = (lo+hi)//2
  if x < a[mid][0]: hi = mid
  else: lo = mid+1
 return lo
N,D,A=map(int,input().split())
lst=[0]*N
for i in range(N):
 lst[i]=list(map(int,input().split()))
 lst[i][1]=int((lst[i][1]-1)/A))+1
lst.sort()
DMG=[0]*(N+1)
ans=0
for i in range(N):
 renji=nibun_right(lst,lst[i][0]+2*D)
 Z=max(lst[i][1]-DMG[i],0)
 DMG[i]+=Z
 DMG[renji]-=Z
 ans+=Z
 DMG[i+1]+=DMG[i]
print(ans)


### FIXED CODE ###

def nibun_right(a, x, lo=0, hi=None):
 if lo < 0:
  raise ValueError('lo must be non-negative')
 if hi is None:
  hi = len(a)
 while lo < hi:
  mid = (lo+hi)//2
  if x < a[mid][0]: hi = mid
  else: lo = mid+1
 return lo
N,D,A=map(int,input().split())
lst=[0]*N
for i in range(N):
 lst[i]=list(map(int,input().split()))
lst.sort()
DMG=[0]*N
ans=0
for i in range(N):
 if i!=0:
  DMG[i]+=DMG[i-1]
 renji=nibun_right(lst,lst[i][0]+2*D)
 Z=max(int((lst[i][1]-1)/A)+1-DMG[i],0)
 DMG[i]+=Z
 if renji!=N:
  DMG[renji]-=Z
 ans+=Z
print(ans)
n=int(input())
for i in range(i,n+1):
    if i%3==0:
        print(' '+str(i),end='')
    elif i%10==3:
        print(' '+str(i),end='')


### FIXED CODE ###

n = int(input())
ans = ""
for i in range(1, n + 1):
    if(i % 3 == 0):
        ans += " " + str(i)
        continue
    x = i
    while(x):
        if(x % 10 == 3):
            ans += " " + str(i)
            break
        x //= 10
print(ans)
n, m, x = map(int, input().split())
a = [int(i) for i in input().split()]

l = sum(1 if i < x else 0 for i in A)
r = m -l

print(min(l,r))


### FIXED CODE ###

n, m, x = map(int, input().split())
a = [int(i) for i in input().split()]

l = sum(1 if i < x else 0 for i in a)
r = m -l

print(min(l,r))
a,b=map(int,input().spllt())
n=b+(a-1)*(b-1)
print(n)

### FIXED CODE ###

a,b=map(int,input().split())
n=b*(b-1)**(a-1)
print(n)
z = input()

z = z.split( )

a = z[0] * z[1]
b = z[0] * 2 + z[1] * 2
print(a + " " + b)


### FIXED CODE ###

z = input()

z = z.split( )
a = int(z[0]) * int(z[1])
b = int(z[0]) * 2 + int(z[1]) * 2

print(str(a) + ' ' + str(b))
A, B, C = map(int, input().split())
if A == B and B != C:
    print("Yes)
elif B == C and C != A:
    print("Yes")
elif C == A and A != B:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
if A == B and B != C:
    print("Yes")
elif B == C and C != A:
    print("Yes")
elif C == A and A != B:
    print("Yes")
else:
    print("No")
=int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)

### FIXED CODE ###

n =int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)
x,y=[int(i) for i in input(num).split()]
print(x*y,(x+y)*2)

### FIXED CODE ###

x,y=[int(i) for i in input().split()]
print(x*y,(x+y)*2)
# -*- coding: utf-8 -*-
A,B,C,D = map(int,input().split())
L = [A:B]
M = [C:D]
print(L&M)

### FIXED CODE ###

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

sup = max(D,B)
inf = min(A,C)

if B-A + D-C <= sup - inf:
    print(0)
else:
    print(B-A+D-C - (sup - inf))
S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        arr.append(st)
        st = ""
    if s in L:
        st += s

print(max(map(len, arr)))


### FIXED CODE ###

S = input()
L = ["A", "C", "G", "T"]

arr = []
st = ""

for s in S:
    if st and s not in L:
        st = ""
    if s in L:
        st += s
        arr.append(st)

print(max(map(len, arr)) if arr else 0)
n= int(input())
a=list(map(int, input().split()))
ans=0
a.sort(reverse=True)
for b in a:
    if b:
        bi=format(b, 'b')
        x=2**len(bi)-b
        if x==b and a.count(x)>1:
            ans+=1
            b=None
            a[a.index(x)]=None
        else:
            ans+=1
            a[a.index(x)]=None
            b=None
print(ans)
  

### FIXED CODE ###

import collections
import bisect
n= int(input())
a=list(map(int, input().split()))
c=collections.Counter(a)
ans=0
des=sorted(a,reverse=True)
# asc=sorted(a)

for i in des:
    if c[i]>0:
        bi=format(i, 'b')
        x=2**len(bi)-i
        c[i]-=1
        if c[x]>0:
            c[x]-=1
            ans+=1
print(ans)
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	#a = int(input())
	x, y, a, b, c = IN()
	al = list(IN())
	al.sort(reverse=True)
	bl = list(IN())
	bl.sort(reverse = True)
	cl = list(IN())
	cl.sort(reverse=True)
	#s = input()
	tx=x-1
	ty=y-1
	tc=0
	while True:
		if tc == len(cl):
			break
		al_min=al[tx] if tx >= 0 else 10**10
		bl_min=bl[ty]
		cl_max=cl[tc]
		if al_min >= cl_max and bl_min >= cl_max:
			break
		elif al_min <= bl_min and al_min < cl_max:
			tx -= 1
			rc += 1
		elif bl_min<= al_min and bl_min < cl_max:
			ty -= 1
			tc += 1
		else:
			break
	ret=sum(al[:tx+1])+sum(bl[:ty+1])+sum(cl[:tc])
	print(ret)
			
		
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

### FIXED CODE ###

import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	#a = int(input())
	x, y, a, b, c = IN()
	al = list(IN())
	al.sort(reverse=True)
	bl = list(IN())
	bl.sort(reverse = True)
	cl = list(IN())
	cl.sort(reverse=True)
	#s = input()
	tx=x-1
	ty=y-1
	tc=0
	while True:
		if tc == len(cl):
			break
		al_min=al[tx] if tx >= 0 else 10**11
		bl_min=bl[ty] if ty >= 0 else 10**11
		cl_max=cl[tc]
		if al_min >= cl_max and bl_min >= cl_max:
			break
		elif al_min <= bl_min and al_min < cl_max:
			tx -= 1
			tc += 1
		elif bl_min<= al_min and bl_min < cl_max:
			ty -= 1
			tc += 1
		else:
			break
	ret=sum(al[:tx+1])+sum(bl[:ty+1])+sum(cl[:tc])
	print(ret)
			
		
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)
test

### FIXED CODE ###

import math

N=int(input())

x=800*N
y=(math.floor(N/15))*200

print(x-y)
import numpy as np

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

a = []

for i in range(m):
    a.append(int(input()))
a.append(n)


def fib(n):
    if n <= 1:
        return n
    return fib(n - 1) + fib(n - 2)


for i in range(1, len(a)):
    sa = a[i] - a[i - 1]
    if sa == 1:
        print("0")
        exit()

a2 = []
for i in range(len(a)):
    if i == 0:
        a2.append(fib(a[i]))
    else:
        a2.append(fib(a[i] - a[i - 1]))

print(np.prod(a2) % 1000000007)


### FIXED CODE ###

n, m = map(int, input().split())
A = set()
for i in range(m):
    a = int(input())
    A.add(a)
dp = [0] * (n + 1)
for i in range(n + 1):
    if i in A:
        dp[i] = 0
    else:
        if i == 0:
            dp[i] = 1
        elif i == 1:
            dp[i] = 1
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007
print(dp[n])

"""
100 5
1
23
45
67
89
"""
import heapq

n,m=map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))
ab.sort()

q=[]
ans=0
for i in range(m):
    while j <= n-1:
        if ab[j][0]<=i+1:
            heapq.heappush(q,-ab[j][1])
        else:
            ans-=heapq.heappop(q)
            break
        j+=1
print(ans)

### FIXED CODE ###

import heapq

n,m=map(int,input().split())
ab=[]
for i in range(n):
    ab.append(list(map(int,input().split())))
ab.sort()

q=[]
ans=0
j=0
for i in range(m):
    while j <= n-1:
        if ab[j][0]<=i+1:
            heapq.heappush(q,-ab[j][1])
        else:
            break
        j+=1
    if len(q)!=0:
        ans-=heapq.heappop(q)
print(ans)
#!/usr/bin/env python3

x = int(input())

ok = False

def dfs(n, flg):
    global ok
    if flg:
        return 
    if n == x:
        ok = True
        return
    if n > x:
        ok = False
        return
    dfs(n+100, ok) 
    dfs(n+101, ok) 
    dfs(n+102, ok) 
    dfs(n+103, ok) 
    dfs(n+104, ok) 
    dfs(n+105, ok) 

dfs(0, False)
if ok: print(1)
else: print(0)


### FIXED CODE ###

#!/usr/bin/env python

x = int(input())

n = x//100

for i in range(n+1):
    tmp = x 
    tmp -= i*100
    if 5*i >= tmp:
        print(1)
        exit()
print(0)
r = int(input())80

a = r
ans = 3 * a * a
print(ans)

### FIXED CODE ###

r = int(input())

a = r
ans = 3 * a * a
print(ans)
N=int(input())
A=list(map(int,input().split()))

A.sort(reverse=True)
P=[]
M=[]

for i in A:
    if i<0:
        M.append(i)
    else:
        P.append(i)
ans=[]
if len(M)==0:
    x=P.pop()
    y=P.pop()
    ans.append([x,y])
    M.append(x-y)
if len(P)==0:
    x=M.pop()
    y=M.pop()
    ans.append([x,y])
    P.append(x-y)


for i in range(len(P)-1):
    y=P.pop()
    x=M.pop()
    ans.append([x,y])
    M.append(x-y)

for i in range(len(M)):
    y=M.pop()
    x=P.pop()
    ans.append([x,y])
    P.append(x-y)

print(P[0])

for x,y in ans:
    print(x,y)







### FIXED CODE ###

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

A.sort(reverse=True)
P=[]
M=[]

for i in A:
    if i<0:
        M.append(i)
    else:
        P.append(i)

ans=[]
if len(M)==0:
    if P[0]==0:
        print(0)
        for i in range(N-1):
            print(0,0)
        exit()
    else:
        x=P.pop()
        y=P.pop(0)
        ans.append([x,y])
        M.append(x-y)
if len(P)==0:
    x=M.pop(0)
    y=M.pop()
    ans.append([x,y])
    P.append(x-y)


for i in range(len(P)-1):
    y=P.pop()
    x=M.pop()
    ans.append([x,y])
    M.append(x-y)

for i in range(len(M)):
    y=M.pop()
    x=P.pop()
    ans.append([x,y])
    P.append(x-y)

print(P[0])

for x,y in ans:
    print(x,y)
c1 = input()
c2 = input()

print("YES" if c1=c2[::-1] else "NO")

### FIXED CODE ###

c1 = input()
c2 = input()

print("YES" if c1==c2[::-1] else "NO")
N=int(input())
S={}
cnt=0
for i in range(N):
    Z=sorted(list(input()))
    K="".join(Z)
    if K in S:
        S[K]+=1
    else:
        S[K]=1
cnt=0
for i in S.values():
    mul=1
    v=1
    if i!=0 and i!=1:
        for t in range(i,1,-1):
            mul*=t
        v=mul/2
        cnt+=v
print(int(cnt))    

### FIXED CODE ###

N=int(input())
S={}
cnt=0
for i in range(N):
    Z=sorted(list(input()))
    K="".join(Z)
    if K in S:
        S[K]+=1
    else:
        S[K]=1
for T in S.values():
    mul=1
    v=1
    if T>1:
        mul=(T*(T-1))//2
        cnt+=mul
    else:
        continue
print(int(cnt))
from collections import Counter
N = int(input())
P = set(tuple(map(int, input().split())) for _ in range(N))

p_q_cand = []
for p in P:
    for q in P:
        if p == q:
            continue
        diff_p = p[0]-q[0]
        diff_q = p[1]-q[1]
        p_q_cand.append((abs(diff_p), abs(diff_q)))

C = Counter(p_q_cand)
p, q = C.most_common()[0][0]
ans = 0
used = set()
for a, b in sorted(P):
    if (a-p, b-q) not in used:
        ans += 1
    used.add((a, b))
print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
P = list(tuple(map(int, input().split())) for _ in range(N))
P = sorted(P)

p_q_cand = []
for i in range(N):
    for j in range(i+1, N):
        diff_p = P[j][0]-P[i][0]
        diff_q = P[j][1]-P[i][1]
        p_q_cand.append((diff_p, diff_q))

if N == 1:
    print(1)
else:
    C = Counter(p_q_cand)
    ans = float('inf')
    for v, c in C.items():
        p = v[0]
        q = v[1]
        tmp = 0
        used = set()
        for a, b in sorted(list(P), key=lambda x: (x[0], x[1])):
            if (a-p, b-q) not in used:
                tmp += 1
            used.add((a, b))
        ans = min(ans, tmp)
    print(ans)
S=input()
if S='SUN':
    print(7)
elif S='MON':
    print(6)
elif S='TUE':
    print(5)
elif S='WED':
    print(4)
elif S='THU':
    print(3)
elif S='FRI':
    print(2)
elif S='SAT'
print(1)


### FIXED CODE ###

S=input()
if S=='SUN':
    print(7)
elif S=='MON':
    print(6)
elif S=='TUE':
    print(5)
elif S=='WED':
    print(4)
elif S=='THU':
    print(3)
elif S=='FRI':
    print(2)
elif S=='SAT':
    print(1)
inputs = input()
a, b = int(inputs.split(' '))
a * n - (n - 1) >= b
print(int((b + 1) / (a -1))


### FIXED CODE ###

from math import ceil

inputs = input()
a = int(inputs.split(" ")[0])
b = int(inputs.split(" ")[1])
print(ceil((b - 1) / (a - 1)))
g=raw_input().split()
a=int(g[0])
b=int(g[1])
if a%2==b%2:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

g=raw_input().split()
a=int(g[0])
b=int(g[1])
if a%2==b%2:
  print((a+b)/2)
else:
  print("IMPOSSIBLE")
key = tuple("keyence")

S = input().rstrip("\n")

idx = 0
for i in S:
    if i == key[idx]:
        idx += 1

if idx == len(key):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

keyence = "keyence"

S = input()

flag = False
for sta in range(len(S)):
    for end in range(sta,len(S)):
        if S[:sta] + S[end:] == keyence:
            flag = True

if flag:
    print("YES")
else:
    print("NO")
import sys
input=sys.stdin.readline
#sys.setrecursionlimit(1000000)

N,Q=map(int,input().split())
l=[[]*N for i in range(N)]
temp=[0]*N
ans=[0]*N

def dfs(i,value):
    ans[i]+=value
    for item in l[i]:
        dfs(item,value+temp[item])

for i in range(N-1):
    a,b=map(int,input().split())
    l[a-1].append(b-1)
    #l[b-1].append(a-1)


for i in range(Q):
    p,x=map(int,input().split())
    temp[p-1]+=x

dfs(0,temp[0])

print(*ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
#パクリゆるして
#グラフのようななにか

import sys
input=sys.stdin.readline
sys.setrecursionlimit(1000000)

from collections import deque


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

tree=[[]*(N+1) for i in range(N+1)]
point=[0]*(N+1)

for _ in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    
for _ in range(Q):
    p,x=map(int,input().split())
    point[p]+=x
#print(point)

d=deque([[1,0]])

while d:
    node,parent=d.popleft()
    point[node]+=point[parent]
    lis=tree[node]
    for child in lis:
        if child==parent:
            continue
        d.append([child,node])
    #print(d)

print(*point[1:])
from collections import deque

def main():
    N = int(input())
    edges = [[] for _ in range(N)]
    ab = []
    ans = {}
    for _ in range(N-1):
        a, b = map(int, input().split())
        edges[a-1].append(b-1)
        edges[b-1].append(a-1)
        ab.append(str(a-1)+str(b-1))
    
    K = max([len(g) for g in edges])
    init = [[0, node, i+1] for i, node in enumerate(edges[0])]  # [parent, current, color]
    que = deque(init)
    for _, _, i in init:
        ans['0'+str(i)] = i
    while que:
        c = 1
        p, node, color = que.popleft()
        next_nodes = edges[node]        
        for next_node in next_nodes:
            if next_node == p:
                continue
            if c == color:
                c += 1
            ans[str(node)+str(next_node)] = c
            que.append([node, next_node, c])
            c += 1

    print(K)
    for key in ab:
        print(ans[key])

if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import deque

def main():
    N = int(input())
    path = [[] for _ in range(N)]
    ab = []
    ans = {}
    visited = [False] * N
    visited[0] = True
    for _ in range(N-1):
        a, b = map(int, input().split())
        path[a-1].append(b-1)
        path[b-1].append(a-1)
        # ab.append(str(a-1)+str(b-1))
        ab.append((a-1, b-1))
    
    que = deque([(0, 0)])
    while que:
        # k = 1
        k = 0
        pre, c = que.popleft()
        for next_node in path[pre]:
            if visited[next_node]:
                continue
            k += 1
            if c == k:
                k += 1
            visited[next_node] = True
            # ans[str(pre)+str(next_node)] = k
            ans[(pre, next_node)] = k
            que.append((next_node, k))
            

    print(max(ans.values()))
    for key in ab:
        print(ans[key])

if __name__ == '__main__':
    main()
S,T = map(input().split())
U = ""
U = U + T + S
print(U)

### FIXED CODE ###

S,T = input().split()
U = ""
U = U + T + S
print(U)
N, M= map(int, input().split(" "))
A = [int(i) for i in input().split()]
count = 0
for i in range(N):
    for k in range(i,N):
        S = sum(A[i:k+1])
        if S % M ==0:
            count = count +1

print(count)


### FIXED CODE ###

N, K = map(int, input().split(" "))

q = N//K
mod = N % K
if mod > 0:
    print(1)
else:
    print(0)
a,b,c=map(int,input().split())
print(max(10*a+(b+c),10*b+(a+c),10*c+(a+c))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(10*max(a,b,c)+a+b+c-max(a,b,c))
import numpy as np
n,a=map(int,input().split())
X=[int(i) for i in input().split()]
tot,m=sum(X),max(X)
DP=np.zeros((n+1,n+1,tot+1),dtype=int)
DP[0][0][0]=1
for i in range(1,n+1):
  for j in range(i+1):
    lim=min(j*m,tot)+1
    for s in range(lim):
      DP[i][j][s]=DP[i-1][j][s]+DP[i-1][j-1][s-X[i-1]]
ans=0
for j in range(1,n+1):
  ans+=DP[n][j][j*a]
print(ans)

### FIXED CODE ###

n,a=map(int,input().split())
X=[int(i) for i in input().split()]
DP=[[[0 for i in range(50*n+1)] for i in range(n+1)] for i in range(n+1)]
DP[0][0][0]=1
for i in range(1,n+1):
  for j in range(i+1):
    for s in range(50*j+1):
      DP[i][j][s]=DP[i-1][j][s]+DP[i-1][j-1][s-X[i-1]]
ans=0
for j in range(1,n+1):
  ans+=DP[n][j][j*a]
print(ans)
k,s = [int(x) for x in input().split()]
ans = 0
for x in range(k+1):
    for y in range(x, k+1):
        z = s - x - y
        if x <= y <= z <= k:
            ans += [ None, 1, 3, 6 ][ len(set([ x, y, z ])) ]

### FIXED CODE ###

print(input().replace(',',' '))
s = list(str(input()))
for i in range(len(s)):
    if s[-(i + 1)] == '?':
        if s[-(i + 2)] == 'P':
            s[-(i + 1)] = 'D'
        else:
            s[-(i + 1)] = 'D'
print(''.join(s))

### FIXED CODE ###

s = list(str(input()))
for i in range(len(s)):
    if s[i] == '?':
        s[i] = 'D'
print(''.join(s))
#!/usr/bin/env python3

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

if A == 0:
    print(0)
elif B == 0:
    print(N)
elif A + B = N or A + B > N and N >= A:
    print(A)
else A + B > N and N < A:
    print(N)
else:
    r = int(N / (A+B))
    q = N % (A+B)
    print(r * A + q)

# -----
# 8 4 2
# bbbbrrbb bb

# 13 4 2
# bbbb rr bbbb rr b

# 2 4 2
# bb

# r = N / (A+B)
# q = N % (A+B)
# r * A + q


### FIXED CODE ###

#!/usr/bin/env python3

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

if A == 0:
    print(0)
elif B == 0:
    print(N)
elif A + B == N:
    print(A)
elif A + B > N and N >= A:
    print(A)
elif A + B > N and N < A:
    print(N)
# 8 10 4
# bbbbbbbb bbrrrr
else:
    r = int(N / (A+B))
    q = N % (A+B)
    if (q <= A):
        print(r * A + q)
    else:
        print(r * A + A)

# 8 1 4
# brrrrbrr rr

# -----
# 8 4 2
# bbbbrrbb bb

# 13 4 2
# bbbb rr bbbb rr b

# 2 4 2
# bb

# r = N / (A+B)
# q = N % (A+B)
# r * A + q
import numpy as np

n, w = map(int, input().split())
wv = np.array([list(map(int, input().split())) for i in range(n)])

dp = np.zeros((w + 1, n))
dp[:, wv[0, 0]] = wv[0, 1]
for i in range(1, n):
    dp[:, i] = dp[:, i - 1]
    wNew, vNew = wv[i, 0], wv[i, 1]
    dp[wNew:, :] = np.fmax(dp[wNew:, :], vNew + dp[:-wNew, :])

print(dp[w, n - 1])


### FIXED CODE ###

import numpy as np


def main():
    N, W = list(map(int, input().split(' ')))
    items = np.array([list(map(int, input().split(' '))) for _ in range(N)])
    dp = np.zeros((N, W + 1))
    dp[0, items[0, 0]:] = items[0, 1]
    for n in range(1, N):
        weight, value = items[n, 0], items[n, 1]
        dp[n, :] = dp[n - 1, :]
        dp[n, weight:] = np.fmax(
            dp[n, weight:],
            value + dp[n - 1, :(- weight)]
        )
    print(int(dp[N - 1, W]))


if __name__ == '__main__':
    main()
N = int(input())
d = map(int,input().split())
recovery_amount = 0 
for i in range(N):
  for j in range(N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)

### FIXED CODE ###

N = int(input())
d = list(map(int,input().split()))
recovery_amount = 0 
for i in range(N):
  for j in range(i,N):
    if i == j:
      continue
    recovery_amount += d[i]*d[j]
print(recovery_amount)
c= list(map(int, input().split()))
print(max(list)-min(list))

### FIXED CODE ###

a, b, c=sorted(map(int, input().split()))
print((b-a)+(c-b))
n = int(input())
l = list(map(int,input().split()))
 
l.sort()
ans = 0
 
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k] :
                    ans += 1
 
print(ans)

### FIXED CODE ###

ss=str(input())
a=int(ss.count("R"))

if ss=="RSR":
  a=1

print(a)