Harryxun/stf_run huggingface dataset:
x,y,z = map(int, input().split())
D = x * y
T=z
 if  D < T :
     print(D)
 else : print(T)

### FIXED CODE ###

x,y,z = map(int, input().split())
D = x * y
T=z
if  D < T :
      print(D)
else : print(T)
s,t=input(),input()
d={"a":0,"b":0,c"":0,"d":0,"e":0,"f":0,g"":0,"h":0,"i":0,"j":0,"k":0,"l":0,"m":0,"n":0,"o":0,"p":0,"q":0,"r":0,"s":0,"t":0,"u":0,"v":0,"w":0,"x":0,"y":0,"z":0}
for i,j in s,t:
  if d[i]==0:d[i]=j
  elif d[i]!=j:print("No");exit()
  if d[j]==0:d[j]=i
  elif d[j]!=i:print("No");exit()
print("Yes")

### FIXED CODE ###

s,t=input(),input()
rs=[""for _ in range(26)]
rt=[""for _ in range(26)]
def a(n):return [chr(ord('a')+i)for i in range(26)].index(n)
for i in range(len(s)):
  ss,tt=a(s[i]),a(t[i])
  if rs[ss]=="":rs[ss]=t[i]
  elif rs[ss]!=t[i]:print("No");exit()
  if rt[tt]=="":rt[tt]=s[i]
  elif rt[tt]!=s[i]:print("No");exit()
print("Yes")
N = int(input())
A = list(map(float,input().split()))
K = N//2 + 1


def dfs(i,K):
    if (i,K) in cache: return cache[(i,K)]
    if i>=N: 
        cache[(i,K)] = 1
        return 1
    if len(A[i:]) < K: 
        res = (1-A[i])*dfs(i+1,K)
    elif len(A[i:]) == K: 
        res = A[i]*dfs(i + 1,K-1)
    else:
        res = A[i]*dfs(i+1,K-1) + (1-A[i])*dfs(i+1,K)
    cache[(i,K)] = res
    return res
cache={}
print(dfs(0,K))
            



### FIXED CODE ###

import collections
N = int(input())
A = list(map(float,input().split()))
K = N//2  + 1
dp = [[0 for _ in range(N + 1) ] for _ in range(N + 1)]
if N == 0: 
    print(0)
    exit
dp[0][0] = 1
ans = 0
for i in range(1,N+1):
    for j in range(i+1):
        if j - 1 < 0:
            dp[i][j] = dp[i-1][j]*(1-A[i-1])
        else:
            dp[i][j] = dp[i-1][j-1]*A[i-1] + dp[i-1][j]*(1-A[i-1])
for i in range(K,len(dp[N])):
        ans+=dp[N][i]
print(ans)
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b==A:
	print("T")
if b==T:
	print("A")
if b==G:
	print("C")
if b==C:
	print("G")



### FIXED CODE ###

import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b=="A":
	print("T")
if b=="T":
	print("A")
if b=="G":
	print("C")
if b=="C":
	print("G")
N, M = [int(item) for item in input().split()]
A = [int(item) for item in input().split()]
A.sort()
for i in range(M):
  B, C = [int(item) for item in input().split()]
  cnt = 0
  while A[cnt] < C and cnt < B:
    A[cnt] = C
    cnt += 1
  A.sort()
print (sum(A))

### FIXED CODE ###

n,m=map(int,input().split())
a=list(map(int,input().split()))
bc=[list(map(int,input().split())) for i in range(m)]
bc.sort(key=lambda x:x[1],reverse=True)
for b,c in bc:
    a.extend([c]*b)
    if len(a)>2*n:
        break
a.sort(reverse=True)
print(sum(a[:n]))
n,k=map(int,input().split())i

while(1):
  m=abs(n-k)

  if m>n:
    print(n)
    break
  else:
    n=m

### FIXED CODE ###

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

x=n%k

y=abs(x-k)

if x<y:
  print(x)
else:
  print(y)
N,M = map(int, input().split())
ar = [0,N]
for m in range(M):
    l,r = map(int, input().split())
    if l>ar[0]:
        ar[0] = l
    if r<ar[1]:
        ar[1]=r
print(max([0,ar[1]-ar[0]+1])

### FIXED CODE ###

N,M = map(int, input().split())
ar = [0,N]
for m in range(M):
    l,r = map(int, input().split())
    if l>ar[0]:
        ar[0] = l
    if r<ar[1]:
        ar[1]=r
print(max([0,ar[1]-ar[0]+1]))
# utf-8:
import numpy as np


def main():
    n = int(raw_input())
    for i in range(n):
        sqrt = np.sqrt(n - i)
        if sqrt - int(sqrt) == 0:
            print(n - i)
            break


if __name__ == '__main__':
    main()


### FIXED CODE ###

# utf-8:
import math as np


def main():
    n = int(raw_input())
    a = int(np.sqrt(n))
    print(a * a)


if __name__ == '__main__':
    main()
def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = map(int, input().split())
    return a + b


if __name__ == "__main__":
    print(solve())


### FIXED CODE ###

def solve():
    age = int(input())
    if age == 1:
        return "Hello World"
    a, b = list(int(input()) for _ in range(2))
    return a + b


if __name__ == "__main__":
    print(solve())
n=int(input())
l=[0]*10
for i in range(n):
  x=input()
  y=x[0]
  if y=='M':
    l[0]+=1
  elif y=='A':
    l[1]+=1
  elif y=='R':
    l[2]+=1
  elif y=='C':
    l[3]+=1
  elif y=='H':
    l[4]+=1
ans=0
for i in range(3):
  for j in range(i+1,i+4):
    for k in range(j+1,j+4):
      sum+=l[i]*l[j]*l[k]
print(sum)


### FIXED CODE ###

n=int(input())
l=[0]*10
for i in range(n):
  x=input()
  y=x[0]
  if y=='M':
    l[0]+=1
  elif y=='A':
    l[1]+=1
  elif y=='R':
    l[2]+=1
  elif y=='C':
    l[3]+=1
  elif y=='H':
    l[4]+=1
ans=0
for i in range(3):
  for j in range(i+1,i+4):
    for k in range(j+1,j+4):
      ans+=l[i]*l[j]*l[k]
print(ans)
import math
n = int(input())
a = list(map(int, input().split()))
s = [0]
small = 10**9
c = 0
for i in range(n-1):
    s.append(math.gcd(a[i], a[i+1]))
    if math.gcd(a[i], a[i+1]) <= small:
        small = math.gcd(a[i], a[i+1])
        c = i+1
s.append(math.gcd(a[n-1], a[0]))
if math.gcd(a[n-1], a[0]) <= small:
    small = math.gcd(a[n-1], a[0])
    c = n
if c != 1 and c != n:
    if s[c-1] > s[c+1]:
        d = c+1
    else:
        d = c-1
if c == 1:
    if s[n] > s[2]:
        d = 2
    else:
        d = n
if c == n:
    if s[n-1] > s[1]:
        d = 1
    else:
        d = n-1
del s[c]
del s[d]
del s[0]
if n == 2:
    ans = max(a)
else:
    ans = min(s)
print(ans)

### FIXED CODE ###

from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
s1 = [0]*(n+1)
s2 = [0]*(n+1)
s1[0] = 0
s1[1] = a[0]
s2[0] = 0
s2[n] = a[n-1]
for i in range(2, n+1):
    s1[i] = gcd(s1[i-1], a[i-1])
    s2[n-i+1] = gcd(s2[n-i+2], a[n-i])
if s1[n-1] >= s2[2]:
    ans = s1[n-1]
else:
    ans = s2[2]
for i in range(2, n):
    b = gcd(s1[i-1], s2[i+1])
    if ans <= b:
        ans = b
print(ans)
S = input()
s = list(S)
j= 0
count = 0
if not s[0] == 'A':
    print('WA')
    exit()

for i in s[2:-1]:
    if i == 'C':
        count += 1
        tmp = j
    j += 1
if not count == 1:
    print('WA')
    exit()

del S[0]
del S[tmp-1]

if S.isupper():
    print('WA')
    exit()

print('AC')

### FIXED CODE ###

s = list(input())
j= 2
count = 0
if not s[0] == 'A':
    print('WA')
    exit()

for i in s[2:-1]:
    if i == 'C':
        count += 1
        tmp = j
    j += 1
if not count == 1:
    print('WA')
    exit()

del s[0]
del s[tmp-1]
s = ''.join(s)

if s.islower():
    print('AC')
    exit()

print('WA')
num = [True]*(100000)
num[0] = num[1] = False
for i in range(2,int(max**0.5)+1):
  if num[i]:
    for j in range(i**2, max, i):
      num[j] = False

for i in int(input()):
  _input = input().split(' ')
  sum = 0
  for i in range(int(_input[0]), int(_input[1])+1):
    if (num[i]) and (num[int((i+1)/2)]):
      sum = sum + 1
  print(sum)

### FIXED CODE ###

num = [True]*100001
num[0] = num[1] = False
for i in range(2,317):
  if num[i]:
    for j in range(i**2, 100000, i):
      num[j] = False

c = [0]*100002
for i in range(3, 100001, 2):
  if (num[i]) and (num[int((i+1)/2)]):
    c[i] = c[i] + 1

for i in range(3, 100001):
  c[i] = c[i] + c[i-1]

for i in range(int(input())):
  _input = input().split(' ')
  print(c[int(_input[1])] - c[int(_input[0])-1])
import fanctions
A,B = map(int,input().split())
m = fanctions.gcd(A,B)
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

l_m = prime_factorize(m)
if len(l_m) >= 1:
    ans = 2
else:
    print("1")
    exit()
for i in range(1,len(l_m)):
    if not l_m[i] == l_m[i-1]:
        ans += 1
print(ans)


### FIXED CODE ###

import fractions
A,B = map(int,input().split())
m = fractions.gcd(A,B)
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

l_m = prime_factorize(m)
if len(l_m) >= 1:
    ans = 2
else:
    print("1")
    exit()
for i in range(1,len(l_m)):
    if not l_m[i] == l_m[i-1]:
        ans += 1
print(ans)
(a, b, c) = (int(i) for i in input().split())
count = 0
for i in range(a, b + 1)
    if c % i == 0:
        count + 1
print(count)

### FIXED CODE ###

(a, b, c) = (int(i) for i in input().split())
count = 0
for i in range(a, (b + 1)):
    if c % i == 0:
        count = count + 1
print(count)
S = int(h = (S / 3600), m = (S / 60), for S in range(0, 60) input())
print('S')

### FIXED CODE ###

S = int(input())

s = S % 60
m = S // 60 % 60
h = S // 60 // 60

print("{0}:{1}:{2}".format(h,m,s))
# ABC060C - Sentou (ARC073C)
n, t = list(map(int, input().rstrip().split()))
lst = list(map(int, input().rstrip().split()))
ans, cur = 0, i[0]
for i in lst[1:]:
    ans += min(t, i - cur)
ans += t
print(ans)

### FIXED CODE ###

# ABC060C - Sentou (ARC073C)
n, t = list(map(int, input().rstrip().split()))
lst = list(map(int, input().rstrip().split()))
ans, cur = 0, lst[0]
for i in lst[1:]:
    ans += min(t, i - cur)
    cur = i
ans += t
print(ans)
P = 10**9+7
fac = [1]
ifac = [1]
ff = 1
for i in range(1,200001):
  ff *= i
  ff %= p
  fac.append(ff)
  ifac.append(pow(ff, p-2, p))
def ncr(n, r, p): 
  return (fac[n] * ifac[r] % p * ifac[n-r] % p);

h,w,a,b = map(int,input().split())
s = 0
nC = b-1
kC = 0
nD = w-b-1+h-1
kD = h-1
for i in range(h-a):
  C = ncr(nC, kC, P)
  D = ncr(nD, kD, P)
  s = (s + C * D) % P
  nC += 1
  kC += 1
  kD -= 1
  nD -= 1
print(s)


### FIXED CODE ###

from math import comb
h,w,a,b = map(int,input().split())
s = 0
nC = b-1
kC = 0
nD = w-b-1+h-1
kD = h-1
p = 1000000007
fac = [1]
ff = 1
for i in range(1,200001):
  ff *= i
  ff %= p
  fac.append(ff)
def ncr(n, r, p): 
  return (fac[n] * pow(fac[r], p-2, p) % p * pow(fac[n-r], p-2, p) % p);

for i in range(h-a):
  C = ncr(nC, kC, 1000000007)
  D = ncr(nD, kD, 1000000007)
  s = (s + C * D) % 1000000007
  nC += 1
  kC += 1
  kD -= 1
  nD -= 1
print(s)
K = input()
S = input()
count = len(S)
list = 0
List = []
for i in range(K):
  a = S[list]
  a.attend(List)
  list = list + 1
if (count <= K):
  print(S)
else:
  print(List+"...")

### FIXED CODE ###

k = int(input())
s = str(input())
if len(s) <= k:
    print(s)
else:
    print((s[:k]) + "...")
N,K,M=map(int, input().split(' '))
Ai =input().split(' ')
Ais = [int(s) for s in Ai]

goal = M*N
if __name__=='__main__':
  rest=goal-sum(Ais)
  print( max(0,rest) if rest<=K else -1 )



### FIXED CODE ###

alpha = 'abcdefghijklmnopqrstuvwxyz'
if __name__=='__main__':
    print(alpha[1+alpha.index(input())])
n= int(input())
a_list=list(map(int,input().split()))
f_list=[0]*n

for i in a_list:
  f_list[i-1]= a_list.index(i)+1

print(n)
for i in f_list:
    print(i,end=' ')
print('')

### FIXED CODE ###

n = int(input())
odd_cnt= len([a for a in range(n+1) if a%2==1])

prob= (odd_cnt)/float(n)

print (prob)
import numpy as np

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

if N == 1:
  print (sum(A))
else:
  C = np.zeros((N, N))

  for i in range(N-1):
    C[i][i] = 0.5
    C[i+1][i] = 0.5

  C[0][N-1] = 0.5
  C[N-1][N-1] = 0.5

  Cin = np.linalg.inv(C)
  B = np.dot(A , Cin)

  print (' '.join(map(lambda x: str(int(x)),B)))

### FIXED CODE ###

import numpy as np

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

X = [0]*N
X[0] = sum(A) - 2 * (sum(A[1:N-1:2]))
for i in range(1, N):
  X[i] = 2 * A[i-1] - X[i-1]
print (' '.join(map(lambda x: str(x), X)))
A = input()
B = input()
print (6-A-B)

### FIXED CODE ###

A = input()
B = input()
print(6-int(A)-int(B))
import sys
import math
input = sys.stdin.readline

N = int(input())
x = []
y = []

for i in range(N):
    p, q = map(int, input().split())
    x.append(p)
    y.append(q)

ans = 0

for i in range(N):
    for j in range(N):
        print ("i="+str(i)+", j="+str(j))
        print ("xi="+str(x[i])+", xj="+str(x[j]))
        print ("yi="+str(y[i])+", yj="+str(y[j]))
        ans += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = ans / N
print (ans)


### FIXED CODE ###


r = int(input())
print (r*r)
if __name__ == '__main__':
    (n, a, b) = map(int, input().split())
    if a == 0: print(0)
    elif n <= a+b:
        print(a)
    else:
    set_count = int(n/(a+b))*a+1
    print(set_count)

### FIXED CODE ###

if __name__ == '__main__':
    (n, a, b) = map(int, input().split())
    ans = (n//(a+b)) * a
    m = min(n%(a+b), a)
    print(ans+m)
while True:
    x, y = list(map(int, input().split()))

    if x == 0 and y == 0:


    





### FIXED CODE ###

while True:
    x, y = list(map(int, input().split()))

    if x == 0 and y == 0:
        break

    if x > y:
        print(y, x)
    else:
        print(x, y)
n = int(input())
a = list(map(int,input().split()))
dic = {}
for i in a:
    s.add(i)
    if i in dic:
        dic[i] +=1
    else:
        dic[i] = 1

ans = 0
for i in dic.values():
    ans += i * (i - 1) // 2

for i in a:
    sa = dic[i] * (dic[i] - 1) // 2 - ((dic[i] - 1) * (dic[i] - 2) // 2)
    print(ans - sa)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
dic = {}
for i in a:
    if i in dic:
        dic[i] +=1
    else:
        dic[i] = 1

ans = 0
for i in dic.values():
    ans += i * (i - 1) // 2

for i in a:
    sa = dic[i] * (dic[i] - 1) // 2 - ((dic[i] - 1) * (dic[i] - 2) // 2)
    print(ans - sa)
import math

n,k = list(map(int,input().split()))

a = list(map(int,input().split()))

middle = math.ceil(max(a) / 2)
oldMiddle = 0
h = 1
rightMin = max(a)

while h > 0:
    cut = 0
    for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
    h = math.ceil(abs(middle - oldMiddle) / 2)
    oldMiddle = middle
    if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h

print(middle)

### FIXED CODE ###

import math

n,k = list(map(int,input().split()))

a = list(map(int,input().split()))

middle = math.ceil(max(a) / 2)
oldMiddle = 0
h = middle // 2
rightMin = max(a)

while h > 0:
    cut = 0
    if middle == 0:
        middle = 1
        break
    for i in range(n):
        cut += math.ceil(a[i] / middle) - 1
    h = math.ceil(abs(middle - oldMiddle) / 2)
    oldMiddle = middle
    if cut <= k:
        if (middle - h == rightMin):
            break
        middle -= h
    else:
        rightMin = middle
        middle += h

print(middle)
a,b=map(int,input())

print((a+b)%24)

### FIXED CODE ###

a,b=map(int,input().split())
 
print((a+b)%24)
import math
l = input().split()
print(math.ceil(l[0]/l[1]))


### FIXED CODE ###

from math import ceil
H, A = map(int, input().split())
print(ceil(H/A))
n = int(input())
a = int(input())
if((a%500)<=b):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

a = int(input())
n = int(input())
if((a%500)<=n):
  print("Yes")
else:
  print("No")
A,B=map(int,input().split())
set = 0
for i in range(1,20):
  if B==1:
    set -=1
    break
  elif A == B:
    set +=1
    break
  elif ((A-1)*i)+A >= B:
    set +=1
    break
  else:
    set +=1
print(set+1)


### FIXED CODE ###

s = input ()
t = input ()
count = 0
for i in range(3):
  if s[i]==t[i]:
    count += 1
print (count)
n=int(input())
a=list(map(int, input().split()))
a_set=set(a)
a_uni=list(a_set)

kazu=[0]*(10**6)
for i in a_uni:
  for j in range(10**6):
    if i*j >= 10 ** 6:
      break
    kazu[i*j] += 1

count = 0
for i in a_uni:
  if kazu[i] == 1:
    count += 1
print(count)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
kazu=[0]*(10**6+1)
for i in a:
  for j in range(i,10**6+1, i):
    if j > 10**6+1:
      break
    if kazu[i] >= 2:
      break
    kazu[j] += 1

count = 0
for i in a:
  if kazu[i] == 1:
    count += 1
print(count)
import fractions
  
def lcm(a,b):
  return (a * b) // fractions.gcd(a, b)

N,M = map(int,input().split())
S = input()
T = input()

if M > N:
  N,M = M,N
  S,T = T,S

X = lcm(N,M)

if fractions.gcd(N,M) == 1 and S[0] == T[0]:
  print(X)
else:
  n = N // fractions.gcd(N,M)
  A = [i * n for i in range(0,N)]
  m = M // fractions.gcd(N,M)
  
  for i in range(X):
    if i // (n * m) == 0:
      if S[n] != T[m]:
        print(-1)
        break
  else:
    print(X)

### FIXED CODE ###

import fractions
  
def lcm(a,b):
  return (a * b) // fractions.gcd(a, b)

N,M = map(int,input().split())
S = input()
T = input()

if M > N:
  N,M = M,N
  S,T = T,S

X = lcm(N,M)

n = N // fractions.gcd(N,M)
m = M // fractions.gcd(N,M)

for i in range(0,X,m):
  if S[0] != T[0]:
    print(-1)
    break
  elif i % n == 0:
    s = i // n
    t = i // m
    if S[t] != T[s]:
      print(-1)
      break
else:
  print(X)
i = 0
while True:
    i++
    x = int(input())
    if x == 0:
        break
    else:
        print('Case {0}: {1}'.format(i, x)

### FIXED CODE ###

i = 0
while True:
    i += 1
    x = int(input())
    if x == 0:
        break
    else:
        print('Case {0}: {1}'.format(i, x))
s = input()
k = int(input())

i = 0
while True:
    if s[i] == '1':
        i += 1
    elif s[i] != '1':
        ans = s[i]
        break
print(ans)


### FIXED CODE ###

s = input()
k = int(input())

if s[0] != '1':
    print(s[0])
else:
    len_1 = 0
    while True:
        if s == '1':
            len_1 = 1
            ans = 1
            break
        if s[0] == '1':
            s = s[1:]
            len_1 += 1
        elif s[0] != '1':
            ans = s[0]
            break
    if k > len_1:
        print(ans)
    else:
        print('1')
X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
l=[]
#print(p,q,r)
delicious=0
for i in range(X):
    l.append(p[i])
for i in range(Y):
    l.append(q[i])
l.sort(reverse=True)
#print(l)
for i in range(len(l)-C):
    #print(l[i])
    delicious=delicious+l[i]
lidx=len(l)-C
cidx=0
#print(delicious,lidx,cidx,l,r,l[lidx],r[cidx])
for j in range(C):
    if l[lidx]<=r[cidx]:
        delicious=delicious+r[cidx]
        cidx=cidx+1
    else:
        delicious = delicious + l[lidx]
        lidx=lidx+1
    #print(delicious)
print(delicious)



### FIXED CODE ###

X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
l=[]
#print(p,q,r)
delicious=0
for i in range(X):
    l.append(p[i])
for i in range(Y):
    l.append(q[i])
l.sort(reverse=True)
#print(l)
for i in range(len(l)-C):
    #print(l[i])
    delicious=delicious+l[i]
lidx=max(0,len(l)-C)
#print(l,r,lidx)
cidx=0
#print(delicious,lidx,cidx,l,r,l[lidx],r[cidx])
for j in range(min(C,X+Y)):
    if (l[lidx]<=r[cidx])or(lidx>len(l)):
        delicious=delicious+r[cidx]
        cidx=cidx+1
    else:
        delicious = delicious + l[lidx]
        lidx=lidx+1
    #print(delicious)
print(delicious)
a,s,d=map(input().split())
if s=="+":
  print(int(a)+int(d))
else:
  print(int(a)-int(d))

### FIXED CODE ###

a,s,d=input().split()
if s=="+":
  print(int(a)+int(d))
else:
  print(int(a)-int(d))
(a, b) = input().rstrip().split('')
a = int(a)
b = int(b)

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')

### FIXED CODE ###

(a, b) = input().rstrip().split(' ')
a = int(a)
b = int(b)

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
a = input()
print(a.replace("?","D")

### FIXED CODE ###

a = input()
print(a.replace("?","D"))
n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
  else:
    move=0
  minheight=h[i]
  ans=max(maxmove,move)
print(ans)
    

### FIXED CODE ###

n=int(input())
h = list(map(int, input().split()))
move=0
maxmove=0
minheight=h[0]

for i in range(1,n):
  if minheight>=h[i]:
    move+=1
    minheight=h[i]
  else:
    maxmove=max(move,maxmove)
    move=0
    minheight=h[i]
print(max(maxmove,move))
N = int(input())
root = int(N**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0]))

### FIXED CODE ###

A, B = map(int,input().split())
ans = A*B if (1 <= A <= 9) and (1 <= B <= 9) else -1
print(ans)
from bisect import bisect_left

n=int(input())
L=list(map(int,input().split()))
L=sorted(L)
ans=0
for i in range(n-2):
    a=L[i]
    for j in range(i+1,n-1):
        ans+=bisect_left(L,a+L[j])-j-1
print(ans)


### FIXED CODE ###

A,B=map(int,input().split())
print(max(0, A-2*B))
S = input()
T = input()

cnt = 0
for i in range(len(S)):
    if S[i] != T[i]:
        cnt += 1
print(cnt)


### FIXED CODE ###

a = int(input())
print(a + a**2 + a**3)
a = input()

mod = a % 1000

b = mod - 1000

c = abs(b)

print(c)

### FIXED CODE ###

a = int(input())
 
mod = a % 1000

if mod == 0:
  print(0)
else:
  b = mod -1000
  c = int(abs(b))
 
  print(c)
N,X,*S=map(int,open(0).read().split())
e=enumerate
d=range(X+1)
for i,s in e(sorted(S)):d=[(t*i+x[j%s])%(10**9+7)for j,t in e(d)]
print(d[-1])

### FIXED CODE ###

N,X,*S=map(int,open(0).read().split())
e=enumerate
d=range(X+1)
for i,s in e(sorted(S)):d=[(t*i+d[j%s])%(10**9+7)for j,t in e(d)]
print(d[-1])
def gmax(a,b):
  if a<b:
    a,b=b,a
  while a%b!=0:
    tmp=a
    a=b
    b=tmp%b
  return b

n=int(input())
x=[]
for i in range(n):
  x.append(int(input()))
    
g=gmax(x[0],x[1])
l=x[0]*x[1]//g

for i in range(2,len(x)):
  g=gmax(x[i],g)
  l=x[i]*l//g

ans=l
print(ans)

### FIXED CODE ###

def gmax(a,b):
  if a<b:
  	a,b=b,a
  while a%b!=0:
    tmp=a
    a=b
    b=tmp%b
  return b
 
n=int(input())
x=[]
for i in range(n):
  x.append(int(input()))

if len(x)!=1:
  g=gmax(x[0],x[1])
  l=x[0]*x[1]//g

  for i in range(2,len(x)):
    g=gmax(x[i],l)
    l=(x[i]*l)//g
else:
  l=x[0]
print(l)
import sys
    sys.setrecursionlimit(3000)
    n,m = map(int,input().split())
    a = [0]*m
    b = [0]*m
    for i in range(m):
      u,v = map(int, input().split())
      a[i] = u-1
      b[i] = v-1
    par = [i for i in range(n)]
    size = [1]*n
    incomb = [n*(n-1)//2]*m
     
    def root(x):
      if par[x] == x: 
        return x
      else:
        par[x] = root(par[x])
        return par[x]
        
    def isSame(x,y):
      return par[x] == par[y]
     
    def union(x,y):
      x = root(x)
      y = root(y)
      if x == y:
        return
      else:
        par[y] = x
        size[x] += size[y]
        
    def size_count(x):
      return size[root(x)]
     
    for i in reversed(range(1,m)):
      q_a = a[i]
      q_b = b[i]
      size_a = size_count(q_a)
      size_b = size_count(q_b)
      if not isSame(q_a,q_b):
        union(q_a,q_b)
        incomb[i-1] = incomb[i] - size_a*size_b
      else:
        incomb[i-1] = incomb[i]
     
    for i in incomb:
      print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n,m = map(int,input().split())
a = [0]*m
b = [0]*m
for i in range(m):
  u,v = map(int, input().split())
  a[i] = u-1
  b[i] = v-1
par = [i for i in range(n)]
size = [1]*n
incomb = [n*(n-1)//2]*m

def root(x):
  if par[x] == x: 
    return x
  else:
    par[x] = root(par[x])
    return par[x]
    
def isSame(x,y):
  return par[x] == par[y]

def union(x,y):
  x = root(x)
  y = root(y)
  if x == y:
    return
  else:
    par[y] = x
    size[x] += size[y]
    
def size_count(x):
  return size[root(x)]

for i in reversed(range(1,m)):
  q_a = a[i]
  q_b = b[i]
  size_a = size_count(q_a)
  size_b = size_count(q_b)
  if not isSame(q_a,q_b):
    union(q_a,q_b)
    incomb[i-1] = incomb[i] - size_a*size_b
  else:
    incomb[i-1] = incomb[i]

for i in incomb:
  print(i)