Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

fact = [1] + [0] * N
for i,ai in enumerate(A, 1):
  fact[i] = fact[i-1] * ai

for i in range(1, N - K + 1):
  score_2 = fact[K + i] // fact[i]
  score_1 = fact[K + i - 1] // fact[i - 1]
  print('Yes' if score_1 < score_2 else 'No')

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

for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

fact = [1] + [0] * N
for i,ai in enumerate(A, 1):
  fact[i] = fact[i-1] * ai

for i in range(K, N):
  score_1 = fact[i] // fact[i-K]
  score_2 = fact[i+1] // fact[i-K+1]
  print('Yes' if score_1 < score_2 else 'No')



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

for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

base = 1

for ai in A[:K]:
  base *= ai

score = [0] * N
score[K-1] = base

for i in range(K, N):
  score[i] = score[i-1] // A[i-K] * A[i]
  print('Yes' if score[i] > score[i-1] else 'No')

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

for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

base = 1

for ai in A[:K]:
  base *= ai

score = [base]

for i in range(K, N):
  s = score[-1] // A[i-K] * A[i]
  score.append(s)
  print('Yes' if score[-1] > score[-2] else 'No')

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

for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = [1] + list(map(int, input().split()))

base = 1

for ai in A[:K+1]:
  base *= ai

score = [base]

for i in range(K+1, N+1):
  s = score[-1] // A[i-K] * A[i]
  score.append(s)

for i in range(1, len(score)):
  print('Yes' if score[i] > score[i-1] else 'No')


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

for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())

sum_A = [0, A[0]]
sum_B = [0, B[0]]

for a in A[1:]:
  sum_A.append(sum_A[-1] + a)

for b in B[1:]:
  sum_B.append(sum_B[-1] + b)

ans = 0
for i in range(N+1):
  for j in range(M+1):
    if sum_A[i] + sum_B[j] <= K:
      ans = max(ans, i+j)

print(ans)


Fixed submission:
N, M, K = map(int, input().split())
A = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))

for i in range(1, N+1):
  A[i] += A[i-1]

for i in range(1, M+1):
  B[i] += B[i-1]


ans = 0
b_count = M
for a_count in range(N+1):
  if A[a_count] > K:
    continue

  while A[a_count] + B[b_count] > K:
    b_count -= 1

  ans = max(ans, a_count + b_count)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

index_A = { a: 0 for a in set(A) }

for a in A:
  index_A[a] += 1

for bc in BC:
  if bc[0] in index_A:
    if bc[1] not in index_A:
      index_A[bc[1]] = 0
    index_A[bc[1]] += index_A[bc[0]]
    index_A[bc[0]] = 0
  print(sum(map(lambda i: i[0]*i[1], index_A.items())))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

indexA = {}

for a in A:
  if a not in indexA:
    indexA[a] = 0
  indexA[a] += 1

sumA = sum(A)

for (b,c) in BC:
  if b in indexA:
    sumA += (c-b) * indexA[b]
    if c not in indexA:
      indexA[c] = 0
    indexA[c] += indexA[b]
    indexA[b] = 0
  print(sumA)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

index_A = { a: 0 for a in set(A) }

for a in A:
  index_A[a] += 1

for bc in BC:
  if bc[0] in index_A:
    if bc[1] not in index_A:
      index_A[bc[1]] = 0
    index_A[bc[1]] += index_A[bc[0]]
    index_A[bc[0]] = 0
  print(sum(map(lambda i: i[0]*i[1], index_A.items())))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
BC = [list(map(int, input().split())) for _ in range(Q)]

indexA = {}

for a in A:
  if a not in indexA:
    indexA[a] = 0
  indexA[a] += 1

sumA = sum(A)

for (b,c) in BC:
  if b in indexA:
    sumA += (c-b) * indexA[b]
    if c not in indexA:
      indexA[c] = 0
    indexA[c] += indexA[b]
    indexA[b] = 0
  print(sumA)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
n = len(input())

MOD = 10**9 + 7

fact = [1] * 2200000
invfact = [1] * 2200000

for i in range(1, 2200000):
  fact[i] = fact[i-1] * i % MOD

invfact[-1] = pow(fact[-1], MOD-2, MOD)

for i in range(2200000-1, 0, -1):
  invfact[i-1] = invfact[i] * i % MOD

def nCk(n, k):
  return fact[n] * invfact[k] * invfact[n-k] % MOD

ans = 0

for l in range(n, n+k+1):
  ans += pow(25, l-n, MOD) * nCk(l-1,n-1) * pow(26, n+k-l, MOD) % MOD
  ans %= MOD

print(ans)


Fixed submission:
k = int(input())
n = len(input())

MOD = 10**9 + 7

fact = [1] * 2200000
invfact = [1] * 2200000

for i in range(1, 2200000):
  fact[i] = fact[i-1] * i % MOD

invfact[-1] = pow(fact[-1], MOD-2, MOD)

for i in range(2200000-1, 0, -1):
  invfact[i-1] = invfact[i] * i % MOD

def nCk(n, k):
  return fact[n] * invfact[k] * invfact[n-k] % MOD

ans = 0

for l in range(n, n+k+1):
  ans += pow(25, l-n, MOD) * nCk(l-1,n-1) * pow(26, n+k-l, MOD) % MOD
  ans %= MOD

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int, input().split()))

ans = math.prod(A)

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


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

A.sort()

if A[0] == 0:
  print(0)
  exit()

ans = 1
for a in A[::-1]:
  ans *= a
  if ans > 10**18:
    print('-1')
    break
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input())
A = list(map(int, input().split()))

ans = math.prod(A)

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


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

A.sort()

if A[0] == 0:
  print(0)
  exit()

ans = 1
for a in A[::-1]:
  ans *= a
  if ans > 10**18:
    print('-1')
    break
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 1
for i in range(1, N):
  Pi = sorted(P[:i+1])
  if Pi[0] >= P[i]:
    count += 1

print(count)


Fixed submission:
N = int(input())
P = list(map(int, input().split()))

minimum = N + 1
ans = 0

for i in range(N):
  if minimum >= P[i]:
    ans += 1
    minimum = P[i]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 1
for i in range(1, N):
  Pi = sorted(P[:i+1])
  if Pi[0] >= P[i]:
    count += 1

print(count)


Fixed submission:
N = int(input())
P = list(map(int, input().split()))

minimum = N + 1
ans = 0

for i in range(N):
  if minimum >= P[i]:
    ans += 1
    minimum = P[i]

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if(i-j < 0):
      break
    dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[-1])


Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if(i-j < 0):
      break
    dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if( i-j >= 0):
      dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[-1])


Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
  for j in range(1, k+1):
    if(i-j < 0):
      break
    dp[i] = min(dp[i], dp[i-j] + abs(h[i-j] - h[i]))

print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

oder = min(S[1:].count('E'), S[:-1].count('W'))

for i in range(1,N-1):
  r = S[i+1:].count('E') + S[:i-1].count('W')
  oder = min(oder, r)

print(oder)


Fixed submission:
N = int(input())
S = input()

oder = N
l = [0 for _ in range(N)]
r = [0 for i in range(N)]

for i in range(1, N):
  l[i] = l[i-1] + (S[i-1] == 'W')
  r[-i-1] = r[-i] + (S[-i] == 'E')

for i in range(N):
  oder = min(oder, l[i]+r[i])

print(oder)
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
result = math.prod([i for i in range(1, n+1)])
print(result%(10**9+7))


Fixed submission:
n = int(input())
result = 1
for i in range(1, n+1):
  result *= i
  result %= 10**9+7
print(result)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
d={}
ans = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      a,b,c = l[i],l[j],l[k]
      if d[(a,b,c)]: continue
      d[(a,b,c)]=1
      ans+=max(a,b,c)<(b+c+a-max(a,b,c))
print(ans)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
ans = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      a,b,c = l[i],l[j],l[k]
      if a != b and b != c and a != c:
        ans+=max(a,b,c)<(b+c+a-max(a,b,c))
print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n):
    res = [None] * n
    for i in range(n):
        res[i] = II()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI()
    return res
def FR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR_(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI_()
    return res
def SR(n):
    res = [None] * n
    for i in range(n):
        res[i] = S()
    return res
def LSR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LS()
    return res
mod = 1000000007
inf = float('INF')

#solve
def solve():
    n, k = LI()
    a = LI()
    for i in range(k - 1):
        if a[i] > a[i + k]:
            print("No")
        else:
            print("Yes")
    return


#main
if __name__ == '__main__':
    solve()


Fixed submission:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n):
    res = [None] * n
    for i in range(n):
        res[i] = II()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI()
    return res
def FR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR(n):
    res = [None] * n
    for i in range(n):
        res[i] = IF()
    return res
def LIR_(n):
    res = [None] * n
    for i in range(n):
        res[i] = LI_()
    return res
def SR(n):
    res = [None] * n
    for i in range(n):
        res[i] = S()
    return res
def LSR(n):
    res = [None] * n
    for i in range(n):
        res[i] = LS()
    return res
mod = 1000000007
inf = float('INF')

#solve
def solve():
    n, k = LI()
    a = LI()
    for i in range(n - k):
        if a[i] >= a[i + k]:
            print("No")
        else:
            print("Yes")
    return


#main
if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[0]*(n+1)
for i in range(10**2+1):
  for j in range(10**2+1):
    for k in range(10**2+1):
      tmp=i**2+j**2+k**2+i*j+j*k+k*i
      if tmp<=n:
        l[tmp]+=1
for li in l:
  print(li)


Fixed submission:
a,b,c=map(int,input().split())
print(b//c-(a-1)//c)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    a.sort()
    ans = 0
    a = a[::-1]
    for i in range(n):
        ans += ans[(i + 1) // 2]
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()


Fixed submission:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    a.sort()
    ans = 0
    a = a[::-1]
    for i in range(1, n):
        ans += a[i // 2]
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
for i in range(int(input())):
  input()
  t=[]
  for i,j in reversed(zip(map(int,input().split()),input())):
    for k in t:i^=x*(i^x<i)
    if i and j=="0":t.append(i)
    if i and j=="1":print(1);break
  else:print(0)

Fixed submission:
for i in range(int(input())):
  input()
  t=[]
  for i,j in zip(map(int,input().split()[::-1]),input()[::-1]):
    for k in t:i^=k*(i^k<i)
    if i and j=="0":t.append(i)
    if i and j=="1":print(1);break
  else:print(0)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    ans = 1
    for ai in a:
        ans *= ai
    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)
    return


#main
if __name__ == '__main__':
    solve()


Fixed submission:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    a = LI()
    a.sort()
    ans = 1
    for ai in a:
        ans *= ai
        if ans > 10 ** 18:
            print(-1)
            return
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    ans = 0
    d = defaultdict(int)
    d[1] = 1 
    for i in range(2, int(sqrt(n - 1)) + 2):
        x = i
        while 1:
            if n % x == 0 and d[x] != 1:
                ans += 1
                n //= x
                d[x] = 1
            else:
                break
            x *= i
        l = i
        for i in range(i + 1):
            d[l*i] = 1
    if d[n]:
        print(ans)
    else:
        print(ans + 1)
    return


#main
if __name__ == '__main__':
    solve()


Fixed submission:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n = II()
    ans = 0
    N = int(sqrt(n))+2
    d = defaultdict(int)
    d[1] = 1 
    for i in range(2, int(sqrt(n - 1)) + 2):
        if d[i] == 0:
            x = i
            while 1:
                if n % x == 0 and d[x] != 1:
                    ans += 1
                    n //= x
                    d[x] = 1
                else:
                    break
                x *= i
            l = i
            j = 1
            while l < N:
                d[l] = 1
                j += 1
                l = i * j
    if d[n]:
        print(ans)
    else:
        print(ans + 1)
    return


#main
if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
    #!/usr/bin/env python3
    from collections import defaultdict,deque
    from heapq import heappush, heappop
    from bisect import bisect_left, bisect_right
    import sys, random, itertools, math
    sys.setrecursionlimit(10**5)
    input = sys.stdin.readline
    sqrt = math.sqrt
    def LI(): return list(map(int, input().split()))
    def LF(): return list(map(float, input().split()))
    def LI_(): return list(map(lambda x: int(x)-1, input().split()))
    def II(): return int(input())
    def IF(): return float(input())
    def S(): return input().rstrip()
    def LS(): return S().split()
    def IR(n): return [II() for _ in range(n)]
    def LIR(n): return [LI() for _ in range(n)]
    def FR(n): return [IF() for _ in range(n)]
    def LFR(n): return [LI() for _ in range(n)]
    def LIR_(n): return [LI_() for _ in range(n)]
    def SR(n): return [S() for _ in range(n)]
    def LSR(n): return [LS() for _ in range(n)]
    mod = 1000000007
    inf = float('INF')

    #solve
    def solve():
        t = S()
        for i in t:
            if i == "?":
                print("D", end="")
            else:
                print(i, end="")
        print()
        return


    #main
    if __name__ == '__main__':
        solve()


Fixed submission:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    t = S()
    for i in t:
        if i == "?":
            print("D", end="")
        else:
            print(i, end="")
    print()
    return


#main
if __name__ == '__main__':
    solve()