peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted


import numpy as np

x,y,z=map(int,input().split())
x-=z
print(x//(y+z))
# Judge status: Accepted
N = int(input())
S = input()

L = 0
R = 0
cnt = 0
d = []
for s in S:
    if s == "(":
       cnt += 1
    else:
        cnt -= 1
        if cnt < 0:
            cnt = 0
            L += 1

R += cnt

print(L*"(" + S + R*")")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
m = a[0]
stool = 0
for i in range(1,n):
  if a[i]>m:
    m = a[i]
  stool = stool + m-a[i]
print(stool)
# Judge status: Accepted
import math

a,b = map(int, input().split())
print(math.ceil((a+b)/2))
# Judge status: Accepted
import collections
import sys
n = int(input())
a = sorted(list(map(int,input().split())))
c = collections.Counter(a)
s = len(set(a))
c = sorted(c.items(), reverse=True)

for i in range(s):
  if c[i][1]>=4:
    print(c[i][0]**2)
    sys.exit()
  elif c[i][1] >=2:
    for j in range(i+1,s):
      if c[j][1]>=2:
        print(c[i][0]*c[j][0])
        sys.exit()
print("0")
# Judge status: Wrong Answer
n,k=map(int,input().split())
h=list(int(input()) for _ in range(n))
h.sort()
s=[abs(h[i+1]-h[i]) for i in range(n-1)]
ans=[s[i]+s[i+1] for i in range(n-2)]
print(min(ans))
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
if(A-B >=  C):
    print(C - (A-B))
else:
    print(0)
# Judge status: Accepted
def solve():
    N = int(input())
    dp = [[0] * 3 for i in range(N + 1)]
    for i in range(N):
        A = list(map(int, input().split()))
        for j in range(3):
            for k in range(3):
                if j != k:
                    dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + A[k])
    return max(dp[N])

print(solve())
# Judge status: Accepted
a=input()
pon = ["0", "1", "6", "8"]
if a[-1] == "3":
  print("bon")
elif a[-1] in pon:
  print("pon")
else:
  print("hon")
# Judge status: Wrong Answer
N = int(input())
P = list(map(int, input().split()))
Q = {}
for i in range(N):
    Q[i + 1] = P[i]

ans = 0
if Q[1] == 1:
    ans += 1
    Q[1], Q[2] = Q[2], Q[1]
for i in range(1, N - 1):
    if Q[i + 1] == i + 1:
        Q[i], Q[i + 1] = Q[i + 1], Q[i]
        ans += 1
print(ans)
# Judge status: Accepted
import collections
n = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
ans = 0
for i in B:
    if i > B[i]:
        ans += B[i]
    else: ans += B[i] - i
print(ans)
# Judge status: Wrong Answer
N, T = map(int, input().split())
ans = 10000;
for i in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    else:
        ans = min(ans, c)
print(ans if ans < T else "TLE")
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))

for i in range(m):
  a.sort()
  t=int(a[-1]/2)
  a.append(t)
print(sum(a))
# Judge status: Accepted
import sys
input = sys.stdin.readline

n = int(input())
print((10**n - (2*9**n-8 **n)) % (10**9 + 7))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if a<=c<=b:print('YES')
else:print('NO')
# Judge status: Wrong Answer
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,k=nii()
s=input()

happy=0
unhappy=0
for i in range(1,n):
  if s[i-1]==s[i]:
    happy+=1
  else:
    unhappy+=1

for i in range(k):
  if unhappy==1:
    happy+=1
    break
  happy+=2
  unhappy-=2

print(happy)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

X,Y = list(map(int, input().rstrip().split()))
#-----
crane = int( (4*X - Y) / 2 )
tortoise = int( (-2*X + Y) / 2 )

if (0 <= crane <= 100) and (0 <= tortoise <= 100):
    if crane == tortoise == 0:
        print("No")
    
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import numpy as np

N = int(input())
a = np.zeros((N,3))
for i in range(N):
    a[i][0],a[i][1],a[i][2] = map(int,input().split())

memo = np.zeros((N,3))

memo[0][0], memo[0][1], memo[0][2] = a[0][0],a[0][1],a[0][2]
day = 1

while (day < N):
    memo[day] = [max(memo[day-1][(x+1)%3],memo[day-1][(x+2)%3]) + a[day][x] \
                   for x in [0,1,2]]
    day += 1

print(max(memo[day - 1]))
# Judge status: Wrong Answer
N=input()
A=list(map(int,input().split()))
count = 0
while sum(A)%2==0:
  A=list(map(lambda x:x/2,A))
  print(A)
  count+=1
print(count)
# Judge status: Accepted
def calcPizza(k, mai):
    return k*mai

a,b,c,x,y = [int(i) for i in input().split(' ')]
mins = min(x,y)

asum = calcPizza(a, x)
bsum = calcPizza(b, y)
absum = calcPizza(c,mins*2)
if x > mins:
    atmp= calcPizza(a,x-mins)
    abtmp= calcPizza(c,(x-mins)*2)
    absum += min(atmp,abtmp)
elif y > mins:
    btmp = calcPizza(b,y-mins)
    abtmp = calcPizza(c,(y-mins)*2)
    absum += min(btmp,abtmp)
print(min(asum+bsum, absum))
# Judge status: Wrong Answer
import math

n = int(input())

m = int(math.ceil(math.log10(n)))
ans = 0

if m == 1:
    x = n % (10 ** 1)
    ans = x
elif m == 2:
    ans = 9
elif m == 3:
    x = n % (10 ** 3)
    ans = 9 + x - 100
elif m == 4:
    ans = 909
elif m == 5:
    if n == 100000:
        ans = 90909
    else:
        x = n % (10 ** 5)
        ans = 909 + x - 10000

print(ans)
# Judge status: Wrong Answer
n = int(input())
ab = [input().split() for _ in [0]*n]
a = [int(i) for i, j in ab][::-1]
b = [int(j) for i, j in ab][::-1]
ans = 0
for i in range(n):
    if a[i] % b[i] != 0:
        ans += b[i] - ((a[i]+ans) % b[i])
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())

for k in range(1,10001):
  if (k*a-c)%b==0:
    print("YES")
    exit()
print("NO")
# Judge status: Accepted
for i in range(1,365+1):print(i%26+1)
# Judge status: Accepted
x = int(input())

def is_prime(x):
	if x<= 1:return False
	for i in range(2,1+int(x**(1/2))):
		if x%i == 0: return False
	return True


def main():
	global x
	while not is_prime(x):
		x += 1

	print(x)

main()
# Judge status: Accepted
n = int(input())
if n%10 == 9 or n//10 == 9:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    N = int(input())
    v = [list(map(int,input().split())) for _ in range(N)]

    dp = [[0]*3 for _ in range(N+1)]

    for i in range(N):
        for j in range(3):
            for k in range(3):
                if j==k:continue
                dp[i+1][k] = max(dp[i+1][k],dp[i][j]+v[i][k])
    print(max(dp[N][i] for i in range(3)))
main()
# Judge status: Accepted
n = int(input())
a = input().split()
a = list(map(int,a))

total = sum(a)

x = 0
arr = []
if n == 2:
    arr.append(abs(a[0]-a[1]))
else:
    for i in range(n-1):
        x += a[i]
        y = total - x
        arr.append(abs(x - y))

print(min(arr))
# Judge status: Accepted
N = int(input())
num = {}

for i in range(N):
    num[i] = 0

A = list(map(int, input().split(" ")))
for i in range(len(A)):
    num[A[i]-1] += 1

[print(num[i]) for i in range(N)]
# Judge status: Accepted
N = int(input())
P = list(map(int,input().split()))

count =0
mi= 3*(10**5) 
for i in range(N):
    if mi >= P[i]:
        count +=1
        mi=P[i]

print(count)
# Judge status: Wrong Answer
# x, k, d = map(int, input().split(' '))
x, k, d = map(int, input().split(' '))
b = x + k * d;
if b > 0:
    a = int(b / (2 * d))
    if a <= k:
        print(max(b-a*2*d, b-(a+1)*2*d))
    else:
        print(b-k*2*d)
else:
    print(-b)
# Judge status: Wrong Answer
import math

def main():
    N, H = list(map(int, input().split()))
    a_max = 0
    b_list = []

    for _ in range(N):
        a,b = list(map(int, input().split()))
        a_max = max(a, a_max)
        b_list.append(b)

    b_list = sorted(b_list)[::-1]
    
    cnt = 0
    for b in b_list:
        if b < a_max:
            break
        H -= b
        cnt += 1
    
    print(cnt + math.ceil(H / a_max))

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a_list = [int(x) for x in input().split()]
temp_list = [0] * n
temp_list[0] = a_list[0]
for i in range(1, n):
    temp_list[i] = a_list[i] + temp_list[i - 1]
ans = 10 ** 15
for i in range(n - 1):
    temp = abs(temp_list[-1] - (temp_list[i] << 1))
    if temp < ans:
        ans = temp
print(ans)
# Judge status: Accepted
s = input().replace('eraser', '').replace('erase', '').replace('dreamer', '').replace('dream', '')

if s:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
N, M = map(int, input().split())
a = [list(map(int, input().split())) for i in range(M)]
r = [0]*N
for i in range(M):
    r[a[i][0] - 1] += 1
    r[a[i][1] - 1] += 1
for i in range(N):
    print(r[i])
# Judge status: Accepted
l = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y = map(int,input().split())
ans = ""
for i in range(3):
    if (x in l[i]):
        if (y in l[i]):
            print("Yes")
            break
        else:
            print("No")
            break
# Judge status: Accepted
from collections import defaultdict

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

count = defaultdict(int)
for i in balls:
  count[i] += 1

def cmb(M):
  return M*(M-1)//2

sum = 0
for i in count:
   sum += cmb(count[i])
#sum = defaultdict(int)
#for i in count:
#  for j in count:
#    if i==j:
#      sum[i] += cmb(count[j]-1)
#    else:
#      sum[i] += cmb(count[j])
#      
for i in balls:
  print(sum - (count[i]-1))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    cnt_4 = 0
    cnt_2 = 0
    for a in A:
        if a % 4 == 0:
            cnt_4 += 1
        elif a % 2 == 0:
            cnt_2 += 1

    print("Yes" if n - max(0, cnt_2 - 1) <= cnt_4 * 2 + 1 else "No")


if __name__ == '__main__':
    resolve()
# Judge status: Accepted

import sys

s = input()

for i in range(len(s)):
    if(i%2 ==0):
        if(s[i] != 'R'and s[i] != 'U' and s[i] != 'D'):
            print('No')
            sys.exit()
    else:
        if(s[i] != 'L'and s[i] != 'U' and s[i] != 'D'):
            print('No')
            sys.exit()

print("Yes")
# Judge status: Wrong Answer
from itertools import permutations
from math import sqrt, pow

n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]

def calc(a, b):
    [x1, y1] = a
    [x2, y2] = b
    return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2))
ans = 0
for i in permutations(range(n)):
    tmp = 0
    for j in range(1, n):
        tmp = calc(l[i[j]], l[i[j-1]])
    ans += tmp
print(ans/n)
# Judge status: Wrong Answer
s = input()
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
aa = [0]*26
ans = "yes"
for i in range(len(s)-1):
    for j in range(26):
        if s[i] == alphabet[j]:
            aa[j] += 1
            if aa[j] >= 2:
                ans = "no"
                break
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
s = input()
k = int(input())

i = 0
while i < len(s) - 1:
    if i == k - 1:
        print(s[i])
        exit()
    if s[i] == "1":
        i += 1
    else:
        print(s[i])
        exit()
print(s[i])
# Judge status: Accepted
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
temp_abs = [abs(j) for j in temp]
mini_temp_abs = min(temp_abs)
for k in range(n):
  if temp_abs[k] == mini_temp_abs:
    print(k+1)
# Judge status: Accepted
X = input()
ans, sc = 0, 0
for x in X:
    if x == 'T':
        sc += 1
    else:
        sc -= 1
    ans = max(ans, sc)
print(ans*2)
# Judge status: Accepted
A, B = map(int, input().split())

if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
div = 1000000007

n, m, *b = map(int, open(0).read().split())
a = set(b)
 
f = [0] * (n + 1)
f[0] = 1

if 1 not in a:
    f[1] = 1
 
for i in range(2, n + 1):
    if i in a:
        continue
    f[i] = (f[i - 1] + f[i - 2]) % div
 
print(f[-1])
# Judge status: Accepted
N, D = map(int, input().split())

cnt = 0
D2 = D*D
for _ in range(N):
  X, Y = map(int, input().split())
  if X**2+Y**2 <= D2:
    cnt += 1
print(cnt)
# Judge status: Accepted
from collections import Counter


cntr = Counter(input())
x_ok, y_ok = False, False
if (cntr["E"] and cntr["W"]) or (not cntr["E"] and not cntr["W"]):
    x_ok = True
if (cntr["N"] and cntr["S"]) or (not cntr["N"] and not cntr["S"]):
    y_ok = True
print("Yes") if x_ok and y_ok else print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
L = {}

count = 0

for i in range(N):
    l = i + A[i]
    r = i - A[i]
    if r in L.keys():
        count += L[r]
    if l in L.keys():
        L[l] += 1
    else:
        L[l] = 1
print(count)
# Judge status: Accepted
import sys
input = sys.stdin.readline

N,M = list(map(int,input().split()))
X = sorted(list(map(int,input().split())))
Xsub = []
for i in range(M-1):
    Xsub.append(X[i+1]-X[i])
    
Xsub = sorted(Xsub)

if N > 1:
    print(sum(Xsub[:-(N-1)] ))   
else:
    print(sum(Xsub))
# Judge status: Wrong Answer
a = int(input())

S = input()

if a >= 3200:
    print('s')

elif a < 3200:
    print('red')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
a.sort()
A = sum(a[1::2])
B = sum(a[::2])

print(A-B)
# Judge status: Wrong Answer
import itertools
n = int(input())
s = [i for i in input()]
ans = 0
gr = itertools.groupby(s)
cnt = 0
for k, g in gr:
    if cnt == 0 and k == ".": continue
    if k == ".": ans += 1
    cnt += 1
print(ans)
# Judge status: Accepted
import collections
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

ss = collections.Counter(s)
tt = collections.Counter(t)
ans = 0
for i in ss:
    sub = ss[i]
    if i in tt:
        sub -= tt[i]
    ans = max(ans, sub)
    
print(ans)
# Judge status: Accepted
import numpy
N = int(input())
List = list(map(int,input().split()))
cumsum = numpy.cumsum(List)
total = sum(List)
result = [abs(total -item*2) for item in cumsum ]
print(min(result[:-1]))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(a + b / 2)
# Judge status: Accepted
k, x = map(int, input().split())
if 500*k >= x:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
a,b,x = map(int,input().split())
if x == a*a*b:
    print(0)
    exit()
if a*a*b/2 < x:
    x = a*a*b - x
    b = x*2/(a*a)
p = x*2/(a*b)
print(math.degrees(math.atan(b/p)))
# Judge status: Wrong Answer
n = int(input())
a_ls = list(map(int, input().split()))
a_ls.sort(reverse=True)
ans = 0
for i in range(n):
    not_divisible = True
    for j in range(i+1,n):
        if a_ls[i] % a_ls[j] == 0:
            not_divisible = False
            break
    if not_divisible:
        ans += 1
if n > 1 and a_ls[-2] == a_ls[-1]:
    ans -= 1
print(ans)
# Judge status: Accepted
N = int(input())
div = 5
if N%2==0:
    ans=0
    N = N//2
    while div <= N:
        ans+=N//div
        div*=5
    print(ans)
else:
    print(0)
# Judge status: Wrong Answer
S = input()

if S[0] != 'A':
    print("WA")
    exit()
if S[2:-1].count('C') != 1:
    print("WA")
    exit()
if S.replace("AC", "").islower == False:
    print("WA")
    exit()
print("AC")
# Judge status: Accepted
import itertools,sys
def I(): return int(sys.stdin.readline().rstrip())
def S(): return sys.stdin.readline().rstrip()
N = I()
s,t = S(),S()
ans = len(s)+len(t)
t_accumulate = list(itertools.accumulate(t))
for x in t_accumulate[::-1]:
    if x in s:
        ans -= len(x)
        break
if ans>=N:
    print(ans)
else:
    print(max(N,len(s)+len(t)))
# Judge status: Accepted
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()

if u == s:
	print(a-1, b)
else:
	print(a, b-1)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
last = A[-1]
count = last
root = 1
for i in range(N):
  if root <= A[i]:
    print(-1)
    break
  if i+1 == N and root-A[i] > A[i+1]:
    root = last + A[i]
  elif root-A[i] > (last + A[i+1]):
    root = (last + A[i+1]) + A[i]
  count+=root
  root = (root-A[i])*2
else:
  if count == 0 or root < last:
    count = -1
  print(count)
# Judge status: Accepted
n,k,s = map(int, input().split())
if s!=10**9:
    x = [10**9]*n
else:
    x = [1]*n

for i in range(k):
    x[i]=s
print(*x)
# Judge status: Wrong Answer
s = input()
t = ''
if s[0] == '?':
    t = 'P'
else:
    t = s[0]
for i in range(1, len(s)):
    if s[i] == '?':
        if t[-1] == 'P':
            t += 'D'
        else:
            t += 'P'
    else:
        t += s[i]
print(t)
# Judge status: Accepted
C = str(input())

print(chr(ord(C)+1))
# Judge status: Accepted

trans = []
n = int(input())
for i in range(5):
	trans.append(int(input()))

m=min(trans)
if n%m==0:
  print(n//m+4)
else:
  print(n//m+5)
# Judge status: Accepted
import bisect

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()

count = 0
for j in range(n):
    i = bisect.bisect_left(A, B[j])
    k = bisect.bisect(C, B[j])
    count += (i * (n - k))

print(count)
# Judge status: Accepted
n = int(input())
L = list(str(input()) for _ in range(n))
print('AC x', L.count('AC'))
print('WA x', L.count('WA'))
print('TLE x', L.count('TLE'))
print('RE x', L.count('RE'))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
manzoku = 0

for i in range(n):
    manzoku += b[a[i]-1]
    if i != 0:
        if (a[i]==a[i-1]+1):
            manzoku += c[a[i-1]-1]

print(manzoku)
# Judge status: Accepted
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

n = inp()
x = ip()
i = 0
ct = 1000
while i < n-1: 
	while i < (n - 1) and x[i + 1] <= x[i]: 
		i += 1
	if i == n - 1: 
		break
	buy = i 
	i += 1
	while i < n and x[i] >= x[i - 1]: 
		i += 1
	sell = i - 1
	
	no = ct//x[buy]
	profit = no*(x[sell]-x[buy])
	ct += profit
print(ct)
# Judge status: Wrong Answer
H1, M1, H2, M2, K = input().split()
H1, M1, H2, M2, K = int(H1), int(M1), int(H2), int(M2), int(K)
allm1 = H1*60+M1
allm2 = H2*60+M2
 
m = allm2 - allm1
 
if m == K:
    print('0')
    exit()
 
i = 0
while True:
    m = m - K
    if m <= 0:
        break
    else:
    	i = i + 1
 
print(i*K)
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = ri()
print(['Christmas Eve Eve Eve', 'Christmas Eve Eve', 'Christmas Eve', 'Christmas'][s-22])
# Judge status: Wrong Answer
s = sorted(input(), reverse = True)
t = sorted(input(), reverse = True)
larger = len(s) if len(s) > len(t) else len(t)
try:
    for i in range(larger):
        if s[i] > t[i]:
            print('No')
            break
        elif s[i] < t[i]:
            print('Yes')
            break
    else:
        print('No')
except:
    if len(s) < len(t):
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
D, N = map(int, input().split())

if N == 100:
  print(101 * 100 ** D)
else:
  print(N * 100 ** D)
# Judge status: Accepted
S = list(input())

if (len(set(S)) == 1):
    ans = 'No'
else:
    ans = 'Yes'

print(ans)
# Judge status: Wrong Answer
num=int(input())
count=0
if(num<3):
    count=0

elif(num>=6):
    for i in range(3,num//2):
        count+=1
    if(num%2==0):
        count=count*2+2
    else:
        count=count*2+1+2
elif(num>2 and num<6):
    count=1
print(count%(10**9+7))
# Judge status: Accepted
n, k = map(int,input().split())
n_k = [0 for i in range(n)]
for i in range(k):
  _n = int(input())
  _k = list(map(int, input().split()))
  for i in _k:
    n_k[i-1] += 1

print(len([1 for i in n_k if i==0]))
# Judge status: Accepted
n = int(input())
print(-n % 1000)
# Judge status: Accepted
a, b, k = [int(x) for x in input().split()]
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
    print(i)
# Judge status: Accepted
n = int(input())
a = [int(e) for e in input().split()]

ans ='No' if max(a)>= sum([e for e in a])-max(a) else 'Yes'
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    max, dif = 0, 0
    for i in range(1, 10000):
        s = i * (i + 1) // 2
        if s >= n:
            max = i
            dif = s - n
            break
    [print(i) for i in range(1, max + 1) if i != dif]

if __name__ == '__main__':
    main()
# Judge status: Accepted
#別解思考
n = int(input())
res = 0
for i in range(1, n // 2 +1):
    res += (int(n / i) * (i + int(n / i) * i)) // 2
res += (n + n // 2 +1) * (n - n // 2 ) //2
print(res)
# Judge status: Accepted
N, M = [int(i) for i in input().split()]

AB = []

for _ in range(N):
    AB.append([int(i) for i in input().split()])

AB = sorted(AB)

money = 0

for i in AB:
    a = M - i[1]
    if a > 0:
        M = a
        money += i[1]*i[0]
    else:
        money += M*i[0]
        break
print(money)
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a<0 and b<0:
    aa=a%2
    bb=b%2

    if (aa+bb)%2==1:
        print("Positive")
    else:
        print("Negative")
    exit()

if a<=0 or 0<=b:
    print("Zero")
    exit()

if 0<a and 0<b:
    print("Positive")
    exit()
# Judge status: Accepted
a,b,c=map(int,input().split()) 
print("Yes" if a<=c<=b or b<=c<=a else "No" )
# Judge status: Accepted
if __name__ == "__main__":
	str = input()
	a,b,c = str.split()
	print(a[0]+b[0]+c[0])
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
x=int(input())
cnt=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if a*500+b*100+c*50==x:
        cnt+=1
print(cnt)
# Judge status: Accepted
frag=0
a = list(input())
N=len(a)-1
for i in range(int(N/2)):
    if a[i]!=a[N-i]:
        frag=1
        break
if frag==0:
    for i in range(int(N/4)):
        if a[i]!=a[int(N/2-i-1)] or a[N-i]!=a[int(N/2+i+1)]:
            frag=1
            break
if frag==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = input()

valid_chars = ["A", "C", "G", "T"]

tmp_ans = 0
ans = 0
for c in s:
    if c in valid_chars:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0

print(ans)
# Judge status: Accepted
c = input()
print('vowel' if 'a' in c or 'i' in c or 'u' in c or 'e' in c or 'o' in c else 'consonant')
# Judge status: Wrong Answer
S=str(input())
min_dif = 1000
for i in range(len(S)-2):
  dif = int(S[i:i+3])
  if min_dif > dif:
    min_dif = dif
print(dif)
# Judge status: Accepted
N=int(input())
S=input()
a=S.count("E")
c=a
for s in S:
  if s=="E":
    c-=1
  else:
    c+=1
  a=min(a,c)
print(a)
# Judge status: Wrong Answer
n = int(input())
S = list(input() for _ in range(n))

if n == 1:
  print()
else:
  def intersect_list(l1, l2):
    arr = []
    lst = l1.copy()
    for element in l2:
      try:
        lst.remove(element)
      except ValueError:
        pass
      else:
        arr.append(element)
    return arr

  l = intersect_list(list(S[0]), list(S[1]))
  for i in range(2, n):
    l = intersect_list(l, list(S[i]))

  l.sort()
  print("".join(l))
# Judge status: Wrong Answer
n=int(input())
if n==0:
  print(0)
  exit()
  
for i in range(n):
  if i**2 > n:
    print((i-1)**2)
    break
# Judge status: Accepted
n = int(input())

itv = []
for i in range(n):
    x,l = map(int,input().split())
    itv.append([x+l-0.1,x-l+0.1])
itv.sort()

ass = 0
tt = -float("inf")
for i in range(n):
    if tt < itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
# Judge status: Accepted
n = int(input())
i = 0
while i**2 <= n:
    i += 1
print((i-1)**2)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    T = rl().rstrip()
    
    ans = []
    for ti in T:
        if ti == '?':
            ans.append('D')
        else:
            ans.append(ti)
    print(''.join(ans))


if __name__ == '__main__':
    solve()
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]

X = 0
for a in A:
  X = X ^ a

for a in A:
  print(X ^ a, end=" ")