Harryxun/stf_run huggingface dataset:
n,k = map(list(int,input()))
if k > (n-1)*(n-2)/2:
  print(-1)
else:
  p = (n-1)*(n-2)/2 - k
  for i in range(2,n+1):
    print(1,i)
  x = 2
  y = 3
  for _ in range(p):
    print(x,y)
    y = y + 1
    if y == n:
      x = x + 1
      y = x + 1

### FIXED CODE ###

n,k = map(int,input().split())
if k > (n-1)*(n-2)/2:
  print(-1)
else:
  p = (n-1)*(n-2)/2 - k
  print(n-1+int(p))
  for i in range(2,n+1):
    print(1,i)
  x = 2
  y = 3
  for _ in range(int(p)):
    print(x,y)
    y = y + 1
    if y == n + 1:
      x = x + 1
      y = x + 1
N,D=list(map(int, input().split()))

print(N//(2*D+1)+1)

### FIXED CODE ###

a = int(input())
s = 3 * a **2
print(s)
from networkx import*
_,*n=map(str.split,open(0))
print(len(max([*connected_components(Graph(n))],key=len)))

### FIXED CODE ###

l=lambda:map(int, input().split())
n,m=l()
p=[-1]*n
def r(x):
  if p[x]<0:return x
  p[x]=r(p[x]);return r(p[x])
def u(x,y):
  x,y=r(x),r(y)
  if x==y: return  
  p[x]+=p[y]
  p[y]=x
def e(x,y):
  return r(x)==r(y)
def s(x):
  return -p[r(x)]
for _ in range(m):
  a,b=l()
  u(a-1,b-1)
print(-min(p))
def calc_cost2(h, k):
    n = len(h)
    if (n == 0):
        return 0

    cost = n * [None]
    for i in range(1, len(h)):        
        tmp = cost[i-1] + abs(h[i] - h[i-1])
        for s in range(max(0, i-k), i):
            tmp = min(tmp, cost[s] + abs(h[i] - h[s]))

        cost[i] = tmp

    return cost[n-1]

if __name__ == "__main__":
    n, k = list(map(int, input().split(" ")))
    h = list(map(int, input().split(" ")))
    res = calc_cost2(h, k)
    print(res)

### FIXED CODE ###

def calc_cost2(h, k):
    n = len(h)
    if (n == 0):
        return 0

    cost = n * [None]
    cost[0] = 0
    for i in range(1, len(h)):
        cost[i] = min([cost[s] + abs(h[i] - h[s]) for s in range(max(0, i-k), i)])
        #cost[i] = min(map(lambda s: cost[s] + abs(h[i] - h[s]), range(max(0, i-k), i)))

    return cost[n-1]


if __name__ == "__main__":
    n, k = list(map(int, input().split(" ")))
    h = list(map(int, input().split(" ")))
    res = calc_cost2(h, k)
    print(res)
a = list(map(int,input().split()))
su = sum(a)
# print(su)
l = [su]*(n+1)
for i in range(1,n+1):
    l[i]=l[i-1]-a[i-1]
# print(l)
count=0
x = 0
m=[1]*(n+1)
for j in range(1,n+1):
    m[j] = m[j-1]*2
    if m[j]>l[j]:
        m[j]=l[j]
    if (m[j]<a[j])or(m[j]==a[j] and j!=n):
        # print(m[j],a[j])
        x = 1
        break
    # print(m[j])
    count += m[j]
    m[j] -= a[j]
count+=1

if x==1 or a[0]!=0 :
    print(-1)
elif n==0:
    print(1)
else:
    print(count)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
if a[0] == 1 and n == 0:
    print(1)
    exit()
su = sum(a)
# print(su)
l = [su]*(n+1)
for i in range(1,n+1):
    l[i]=l[i-1]-a[i-1]
# print(l)
count=0
x = 0
m=[1]*(n+1)
for j in range(1,n+1):
    m[j] = m[j-1]*2
    if m[j]>l[j]:
        m[j]=l[j]
    if (m[j]<a[j])or(m[j]==a[j] and j!=n):
        # print(m[j],a[j])
        x = 1
        break
    # print(m[j])
    count += m[j]
    m[j] -= a[j]
count+=1

if x==1 or a[0]!=0 :
    print(-1)
else:
    print(count)
def main(num):
    num = int(input())
    for i in range(1,10):
        q, mod = divmod(num, i)
        if mod == 0 and q < 10:
            return "Yes"

    return "No"
if __name__ == "__main__":
    print(main())

### FIXED CODE ###

def main():
	num = int(input())
	for i in range(1,10):
		q, mod = divmod(num, i)
		if mod == 0 and q < 10:
			return "Yes"

	return "No"
if __name__ == "__main__":
    print(main())
import sys
sys.setrecursionlimit(1000000)
N, M = map(int, input().split())
G = {k: [] for k in range(N+1)}
for _ in range(N):
    a, b = map(int, input().split())
    # 無向グラフ
    G[a-1].append(b-1)
    G[b-1].append(a-1)

visited = [False]*N
visited[0] = True


def dfs(v):
    if all(visited):
        return 1
    r = 0
    for nv in G[v]:
        if visited[nv] is False:
            visited[nv] = True
            r += dfs(nv)
            visited[nv] = False
    return r


print(dfs(0))


### FIXED CODE ###

import itertools

N,M=map(int,input().split())
route=[list(map(int,input().split())) for _ in range(M)]
candidate=list(itertools.permutations(range(1,N+1)))

ans=0
for c in candidate:
  if c[0]==1:
    for i in range(N-1):
      l=sorted([c[i], c[i+1]])
      if l not in route:
         break
    else:
      ans+=1
print(ans)
import math
from functools import reduce

n = int(input())
a = [int(i) for i in input().split()]

ans1 = ans2 = 0
li_ans = []


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


lcm = lcm_list(a)

for num in a:
    ans1 += (lcm - 1) % num
    ans2 += (lcm + 1) % num

print(max(ans1, ans2))


### FIXED CODE ###

import fractions
from functools import reduce
 
 
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
 
 
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
 
 
n = int(input())
a = [int(i) for i in input().split()]
 
ans1 = 0
 
lcm = lcm_list(a)
 
for num in a:
    ans1 += (lcm - 1) % num
 
print(ans1)
a=input()
a=int(a)
b=input()
b=input(b)
c=input()
c=int(c)
d=input()
f=list[a,b,c,d]
print(f[0]+f[1])

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d= int(input())


f=[a,b]
f=sorted(f)
g=[c,d]
g=sorted(g)
    
print(f[0]+g[0])
from collections import deque
n,k,q = map(int, input().split())
start = [k-q]*n
points = deque(start)
for i in range(q):
    point = int(input())
    points[i-1] += 1
for _ in range(len(points)):
  x = points.popleft()
  if x <= 0:
    print('No')
  else:
    print('Yes')

### FIXED CODE ###

n,k,q=map(int,input().split())
a=[k-q]*n
for i in range(q):
    point=int(input())
    a[point-1] += 1
for i in range(len(a)):
    if a[i] > 0:
        print("Yes")
    else:
        print("No")
a,b,c,d,e,f = map(int, input().split())
s_max = f*e//(e+100)
w_max = f//(e+100)

s=[]
w=[]

max = 0
ans = []
for i in range(s_max//c+1):
    for j in range(s_max//d+1):
        if c*i + d*j <= s_max:
            s.append(c*i + d*j)

for i in range(w_max//a+1):
    for j in range(w_max//b+1):
        if 0<a*i + b*j <= w_max:
            w.append(a*i + b*j)

for i in range(len(s)):
    for j in range(len(w)):
        if s[i]/(w[j]*100+s[i])<=e/(e+100) and s[i]/(w[j]*100+s[i])>max:
            max = s[i]/(w[j]*100+s[i])
            ans = [w[j]*100+s[i],s[i]]

print(ans[0],ans[1])


### FIXED CODE ###

a,b,c,d,e,f = map(int, input().split())
s_max = f*e//(e+100)
w_max = f//100

s=[]
w=[]

max = 0
ans = [100*a,0]
for i in range(s_max//c+1):
    for j in range(s_max//d+1):
        if c*i + d*j <= s_max:
            s.append(c*i + d*j)

for i in range(w_max//a+1):
    for j in range(w_max//b+1):
        if 0<a*i + b*j <= w_max:
            w.append(a*i + b*j)

for i in range(len(s)):
    for j in range(len(w)):
        if s[i]/(w[j]*100+s[i])<=e/(e+100) and s[i]/(w[j]*100+s[i])>=max and w[j]*100+s[i]<=f:
            max = s[i]/(w[j]*100+s[i])
            ans = [w[j]*100+s[i],s[i]]

print(ans[0],ans[1])
N = int(input())
M = 10
L = 2*M
A = [[0 for _ in range(L+1)] for _ in range(L+1)]

for _ in range(N):
  y = float(input())
  x = y
  x *= 10.**M
  x = int(x)
  k_2 = 0
  while x % 2 == 0 and k_2 <= 2*M:
    x = x // 2
    k_2 += 1
  k_5 = 0 
  while x % 5 == 0 and k_5 <= 2*M:
    x = x // 5
    k_5 += 1
  A[k_2][k_5] += 1

ans = 0
for k_2 in range(L+1):
  for k_5 in range(L+1):
    for l_2 in range(k_2, L+1):
      for l_5 in range(L+1):
        if k_2+l_2 >= 2*M and k_5+l_5 >= 2*M:
          if k_2 == l_2 and k_5 == l_5:
            ans += A[k_2][k_5]*(A[k_2][k_5]-1)//2
            
          elif l_2 > k_2 or (k_2 == l_2 and k_5 < l_5):
            ans += A[k_2][k_5]*A[l_2][l_5]
          
#print(A)
print(ans)

### FIXED CODE ###

N = int(input())
M = 10
L = 2*M
A = [[0 for _ in range(L+1)] for _ in range(L+1)]

for _ in range(N):
  y = float(input())
  x = y
  x *= 10.**M
  x = int(x+0.1)
  k_2 = 0
  while x % 2 == 0 and k_2 < 2*M:
    x = x // 2
    k_2 += 1
  k_5 = 0 
  while x % 5 == 0 and k_5 < 2*M:
    x = x // 5
    k_5 += 1
  A[k_2][k_5] += 1

ans = 0
for k_2 in range(L+1):
  for k_5 in range(L+1):
    for l_2 in range(k_2, L+1):
      for l_5 in range(L+1):
        if k_2+l_2 >= 2*M and k_5+l_5 >= 2*M:
          if k_2 == l_2 and k_5 == l_5:
            ans += A[k_2][k_5]*(A[k_2][k_5]-1)//2
          elif l_2 > k_2 or (k_2 == l_2 and k_5 < l_5):
            ans += A[k_2][k_5]*A[l_2][l_5]          
#print(A)
print(ans)
import math
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = [-1]
b.extend(a)
b.extend([N+1])
ans = 1
import sympy as sym
def fibo(n):

    x = sym.symbols('x',nonnegative=True,integer=True)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1))
    result=Fib.subs(x,n)
    result=sym.simplify(result) #式の整理
    return result

for i in range(M+1):
    dan = b[i+1]-1 - b[i]
    ans = ans*fibo(dan+1)%1000000007
print(ans)

### FIXED CODE ###

import math
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = [-1]+ a+ [N+1]
fib = [0,1]
for i in range(10**5):
    fib.append((fib[-1]+fib[-2])%1000000007)
ans = 1
for i in range(len(b)-1):
    ans= (ans*fib[b[i+1]-b[i]-1])%1000000007
print(ans)
while True:
	n = input()
	x = []
	y = [0 for i in range(n+1)]
	for i in range(n):
		a = map(int, raw_input().split())
		a.append(sum(a))
		x.append(a)
		for j in range(n+1):
			y[j] += a[j]
	x.append(y)
	for a in x:
		print "".join([str(e).rjust(5) for e in a])

### FIXED CODE ###

while True:
	n = int(raw_input())
	if n == 0:
		break
	a = [map(int, raw_input().split()) for i in xrange(n)]
	a = [l + [sum(l)] for l in a]
	a.append([sum([l[i] for l in a]) for i in xrange(len(a[0]))])
	print "\n".join(["".join([str(i).rjust(5) for i in l]) for l in a])
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

print(cmb(N, 2) + cmb(M, 2))


### FIXED CODE ###

N, M = map(int, input().split())
ans = ((N * (N-1)) / 2) + ((M * (M-1)) / 2)
print(int(ans))
s=input()
if(s-"2019/4/30" >0):
   print("TBD")
else:
   print("Heisei")

### FIXED CODE ###

s=input()
if(s>"2019/04/30"):
   print("TBD")
else:
   print("Heisei")
aas = [int(input()) for _ in range(5)]
k = int(input())
for i in range(1,5):
  if aas[i]-aas[i-1]>k:
    print(':(')
    exit()
print('Yay!)

### FIXED CODE ###

aas = [int(input()) for _ in range(5)]
k = int(input())
print('Yay!' if max(aas)-min(aas)<=k else ':(')
import numpy as np
 
a, b, c = map(int, input().split())

if c - a - b > 0 and 4 * a * b < (c - a - b)**2:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

a, b, c = map(int, input().split())
 
if c - a - b > 0 and 4 * a * b < (c - a - b)**2:
  print("Yes")
else:
  print("No")
x,k,d = map(int,input().split())
if x >= 0:
  min_p = x//d
  min_n = min_p + 1
  rest_p = x- d*min_p
  rest_n = rest_p - d
  if (k-min_p) % 2 == 0:
    print(rest_p)
  else:
    print(abs(rest_n))
    
if x <0:
  min_n = abs(x)//d
  min_p = min_p + 1
  rest_n = x + d*min_p
  rest_p = rest_p + d
  if (k-min_p) % 2 == 0:
    print(rest_p)
  else:
    print(abs(rest_n))
  

### FIXED CODE ###

x,k,d = map(int,input().split())

min_p = abs(x)//d
min_n = min_p + 1
rest_p = abs(x)- d*min_p
rest_n = rest_p - d

if k < min_p:
  print(abs(x) - k*d)
elif (k-min_p) % 2 == 0:
  print(rest_p)
else:
  print(abs(rest_n))
import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
perms = []
for i in itertools.permutations([j+1 for j in range(n)]):
    perms.append(list(i))
perms.sort()
for i in range(len(perms)):
    if perms[i]==p:
        rp = i
    elif perms[i] ==q:
        rq = i
print(abs(rq-rp))


### FIXED CODE ###

import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
perms = []
for i in itertools.permutations([j+1 for j in range(n)]):
    perms.append(list(i))
perms.sort()
for i in range(len(perms)):
    if perms[i]==p:
        rp = i
    if perms[i] ==q:
        rq = i
print(abs(rq-rp))
from collections import*
z,v,a=input,range,print
h,w,k=map(int,z().split());r,s,t,u=map(lambda x:int(x)-1,z().split())
b=[z()for _ in v(h)];l=[[-1]*w for _ in v(h)];l[r][s]=0
d=deque([(r,s)])
while d:
  x,y=d.popleft();j=l[x][y]
  if(x==t)&(y==u):exit(a(j))
  for e,f in[[1,0],[-1,0],[0,-1],[0,1]]:
    for i in v(1,k+1):
      p,q=x+e*i,y+f*i
      if not((0<=p<h)&(0<=q<w))or b[p][q]=="@" or 0<=(c:=l[p][q])<=j:break
      if c<0:d+=[(p,q)];l[p][q]=j+1
a(-1)

### FIXED CODE ###

import sys
inf=1000002
sys.setrecursionlimit(inf)
from collections import deque
h,w,k=map(int,input().split())
x1,y1,x2,y2=map(int,input().split())
c=[input() for i in range(h)]
dp=[[inf if c[i][j]=="." else -1 for j in range(w)] for i in range(h)]
now=deque()
now.append([x1-1,y1-1])
dp[x1-1][y1-1]=0
#kの更新が遅い
def bfs(d):
    global h,w,k,dp,now,x2,y2
    l=len(now)
    if l==0:
        return
    dp_sub=deque()
    cand=set()
    for i in range(l):
        x,y=now.popleft()
        for j in range(1,min(k+1,w-y)):
            if dp[x][y+j]==inf:
                dp_sub.append([x,y+j,d])
                #dp[x][y+j]=d
                cand.add((x,y+j))
                #now.append([x,y+j])
            else:
                break
        for j in range(1,min(k+1,y+1)):
            if dp[x][y-j]==inf:
                dp_sub.append([x,y-j,d])
                #dp[x][y-j]=d
                cand.add((x,y-j))
                #now.append([x,y-j])
            else:
                break
        for j in range(1,min(k+1,h-x)):
            if dp[x+j][y]==inf:
                dp_sub.append([x+j,y,d])
                #dp[x+j][y]=d
                cand.add((x+j,y))
                #now.append([x+j,y])
            else:
                break
        for j in range(1,min(k+1,x+1)):
            if dp[x-j][y]==inf:
                dp_sub.append([x-j,y,d])
                #dp[x-j][y]=d
                cand.add((x-j,y))
                #now.append([x-j,y])
            else:
                break
    while dp_sub!=deque([]):
        e=dp_sub.popleft()
        dp[e[0]][e[1]]=e[2]
    for i in cand:
        now.append(i)
    bfs(d+1)
bfs(1)
print(dp[x2-1][y2-1] if dp[x2-1][y2-1]!=inf else -1)
import sys
input=sys.stdin.readline


def solve():
    N = int(input())
    d = {i:-1 for i in range(1, N+1)}
    *l, = map(int, input().split())

    MOD = 10**9+7
    n = N+1
    fac = [1]*(n+1)
    rev = [1]*(n+1)
    
    for i in range(1,n+1):
    fac[i] = i*fac[i-1]%MOD
    rev[i] = pow(fac[i], MOD-2, MOD)
    
    comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD if a>=b else 0

    for i, j in enumerate(l):
        if d[j] != -1:
            break
        d[j] = i

    v = d[j]+N-i
    for i in range(1, N+2):
        print((comb(N+1, i)-comb(v, i-1))%MOD)


if __name__ == "__main__":
    solve()


### FIXED CODE ###

N = int(input())
d = {i:-1 for i in range(1, N+1)}
*l, = map(int, input().split())

MOD = 10**9+7
n = N+1
fac = [1]*(n+1)
rev = [1]*(n+1)
 
for i in range(1,n+1):
  fac[i] = i*fac[i-1]%MOD
  rev[i] = pow(fac[i], MOD-2, MOD)
 
comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD if a>=b else 0

for i, j in enumerate(l):
    if d[j] != -1:
        break
    d[j] = i

a = d[j]
b = N-i
for i in range(1, N+2):
    print((comb(N+1, i)-comb(a+b, i-1))%MOD)
n = int(input())
s = str(input())
r = []
g = []
b = []
for i in range(n):
  if s[i] == "R":
    r.append(i)
  elif s[i] == "G":
    g.append(i)
  else:
    b.append(i)
c = len(r)*len(g)*len(b)
for ri in r:
  for gi in g:
    for bi in b:
      if 3*(max(ri,gi,bi)+min(ri,gi,bi)) == 2*sum(ri,gi,bi):
        c -= 1
print(c)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
s = str(input())
r = 0
g = 0
for i in range(n):
  if s[i] == "R":
    r += 1
  elif s[i] == "G":
    g += 1
c = r*g*(n-r-g)
for j in range(1,n-1):
  for i in range(1,min(n-j-1,j)+1):
    if (s[j-i] != s[j]) and (s[j] != s[j+i]) and (s[j+i] != s[j-i]):
      c -= 1
print(c)
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
#import math
#import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
#ts=time.time()
#sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
show_flg=True

def solve2(b,k):
    if len(b)*k<50:#0**5:
        return naive(b,k)
    
    rt=naive(b,1)*k
    if b[0]==b[-1] and (len(b)>=3 and (b[0]==[1] or b[-2]==[-1])):
        rt+=-1
    return rt
    
def solve(b,k):
    '''
    b=StoI()
    a=b+[b[0]]
    k=I()
    '''
    if len(b)*k<100:#0**5:
        return naive(b,k)
    else:
        naive(b,3)
        
    a=b+[b[0]]
    n=len(a)
    
    
    p=a[0]
    t=0
    for i in range(n-1):
        if p==a[i+1]:
            t+=1
            p=-1
        else:
            p=a[i+1]
    
    ans=t*k
    if n==2:
        ans=k//2
    if len(Counter(b))==1:
        ans=(k*len(b))//2
    if b[0]==b[-1]:
        ans=(naive(b,4))*(k//4)+(naive(b,k%4) if k%4!=0else 0)-1
    #print(ans)
    return ans

def naive(b,k):
    a=b*k
    n=len(a)
    
    p=a[0]
    t=0
    for i in range(n-1):
        if p==a[i+1]:
            t+=1
            p=-1
        else:
            p=a[i+1]
            
    #print()
    return t


b=StoI()
k=I()
print(naive(b,k))

### FIXED CODE ###

from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
#import math
#import time
#import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
#ts=time.time()
#sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
show_flg=False
show_flg=True

def naive(b,k):
    a=b*k
    n=len(a)
    
    p=a[0]
    t=0
    for i in range(n-1):
        if p==a[i+1]:
            t+=1
            p=-1
        else:
            p=a[i+1]
            
    return t


b=StoI()
a=b
k=I()
n=len(a)
p=a[0]
t=0

if len(b)*k<10:
    print(naive(b,k))
    exit()


for i in range(n-1):
    if p==a[i+1]:
        t+=1
        p=-1
    else:
        p=a[i+1]

odd=naive(b,3)-naive(b,1)
even=naive(b,4)-naive(b,2)
if k%2==1:
    ans=naive(b,1)+(k//2)*odd
else:


    ans=naive(b,2)+(k//2)*even-even
print(ans)
str1 = input()
n = len(str1)
m = (n-1)/2
o = (n+3)/2
str2 = str1[:m]
str3 = str1[o:n]
if str1 != str1[::-1]:
	print("No")
else:
  	if str2 != str2[::-1]:
    	print("No")
    else:
    	if str3 != str3[::-1]:
        	print("No")
        else:
        	print("Yes")
    	
	

### FIXED CODE ###

str1 = input()
n = len(str1)
m = int((n-1)/2)
o = int((n+3)/2)
str2 = str1[:m]
str3 = str1[(o-1):n]
if str1 != str1[::-1]:
	print("No")
else:
    if str2 != str2[::-1]:
	    print("No")
    else:   
        if str3 != str3[::-1]:
            print("No")
        else:
            print("Yes")
a,b,c=map(int,input().split())

print(len(set(a,b,c)))

### FIXED CODE ###

a,b,c=map(int,input().split())

print(len({a,b,c}))
import sys
input = sys.stdin.readline

n,k = map(int,input().split())
A = list(map(int,input().split()))
mod = 10**9 + 7

# from random import randint
# n = 10
# k = 4
# A = []
# for i in range(10):
#     A.append(randint(-20,20))
# anss=0
# for i in range(n):
#     for j in range(i+1,n):
#         for ii in range(j+1,n):
#             for jj in range(ii+1,n):
#                 anss = max(anss, A[i]*A[j]*A[ii]*A[jj])
# print(anss)
# print(A)


B = [[], []]
for i in range(n):
    if A[i] >= 0:
        B[0].append(A[i])
    else:
        B[1].append(A[i])
B[0].sort(reverse=True)
B[1].sort()

if k%2==1 and len(B[0])==0:
    ans = 1
    ind = len(B[1])-1
    for i in range(k):
        ans = (ans * B[1][ind]) % mod
        ind -= 1
    print(ans)
else:
    k0 = min(len(B[0]), k)
    k1 = k-k0
    if k1%2==1:
        k0 -= 1
        k1 += 1
    # print(B,k0,k1)
    while k1+1 < len(B[1]) and k0-2 >= 0 and B[1][k1]*B[1][k1+1] > B[0][k0-1]*B[0][k0-2]:
        k1 += 2
        k0 -= 2
        # print(k0,k1)
        # print(k1+1 < len(B[1]),B[1][k1]*B[1][k1+1] , B[0][k0-1]*B[0][k0-2])
    ans = 1
    for i in range(k0):
        ans = (ans * B[0][i]) % mod
    for i in range(k1):
        ans = (ans * B[1][i]) % mod
    print(ans)



### FIXED CODE ###

import sys
input = sys.stdin.readline

n,k = map(int,input().split())
A = list(map(int,input().split()))
mod = 10**9 + 7

# from random import randint
# n = 10
# k = 4
# A = []
# for i in range(10):
#     A.append(randint(-20,20))
# anss=0
# for i in range(n):
#     for j in range(i+1,n):
#         for ii in range(j+1,n):
#             for jj in range(ii+1,n):
#                 anss = max(anss, A[i]*A[j]*A[ii]*A[jj])
# print(anss)
# print(A)


B = [[], []]
for i in range(n):
    if A[i] >= 0:
        B[0].append(A[i])
    else:
        B[1].append(A[i])
B[0].sort(reverse=True)
B[1].sort()

if k % 2 == 1 and len(B[0]) == 0:
    ans = 1
    ind = len(B[1])-1
    for i in range(k):
        ans = (ans * B[1][ind]) % mod
        ind -= 1
    print(ans)
elif k == n and len(B[1]) % 2 == 1:
    ans = 1
    for i in range(n):
        ans = (ans * A[i]) % mod
    print(ans)
else:
    k0 = min(len(B[0]), k)
    k1 = k-k0
    if k1%2==1:
        k0 -= 1
        k1 += 1
    # print(B,k0,k1)
    while k1+1 < len(B[1]) and k0-2 >= 0 and B[1][k1]*B[1][k1+1] > B[0][k0-1]*B[0][k0-2]:
        k1 += 2
        k0 -= 2
        # print(k0,k1)
        # print(k1+1 < len(B[1]),B[1][k1]*B[1][k1+1] , B[0][k0-1]*B[0][k0-2])
    ans = 1
    for i in range(k0):
        ans = (ans * B[0][i]) % mod
    for i in range(k1):
        ans = (ans * B[1][i]) % mod
    print(ans)
a, b, k = input().split(" ")
if a+b <= k:
  print("0 0")
elif a >= k:
  print(f'{a-k} 0')
else:
  print(f'0 {(a+b)-k}')

### FIXED CODE ###

a, b, k = map(int, input().split(" "))
if a+b <= k:
  print('0 0')
elif a >= k:
  c = a-k
  print(c, ' ', b)
else:
  c = (a+b)-k
  print('0 ', c)
T = input()

times = len(T)

list = []

for i in range(times):
    if i == len(T):
        if T[i] == 'P' or T[i] == 'D':
            list.append(T[i])
        else:
            list.append('D')
    
    else:
        if T[i] == '?':
            list.append('D')
        else:
            if T[i+1] == '?' or T[i+1] == 'D':
                list.append('P')
            else:
                list.append('D')

print(''.join(list))

### FIXED CODE ###

t = input()
print(t.replace("?", "D"))