Harryxun/stf_run huggingface dataset:
import math
def main():
    n, k = [int(i) for i in input().split()]
    h = [int(i) for i in input().split()]
    memo = [0 for _ in range(n)]
    memo[1] = abs(h[0] - h[1])
    for i in range(2,n):
        k_max = max(k, i-1)
        memo[i] = min([memo[i-j] + abs(h[i]-h[i-j])for j in range(1, k_max)])
    print(memo[-1])


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    n, k = [int(i) for i in input().split()]
    h = [int(i) for i in input().split()]
    memo = [10e9 for _ in range(n)]
    memo[0] = 0
    for i in range(n):
        for j in range(1, min(n-i,k+1)):
            memo[i+j] = min(memo[i+j], memo[i] + abs(h[i] - h[i+j]))
    print(memo[-1])


if __name__ == '__main__':
    main()
N, M = map(int, input().split())
ans = 0
for i in range(1, (M + N - 2) // (N - 1)):
    if (M - i * (N - 1)) % i == 0:
        ans = i
print(ans)


### FIXED CODE ###

def enum_divisors(n):
    res = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            res.append(i)
            if i != n // i:
                res.append(n // i)
    return res


N, M = map(int, input().split())
divs = filter(lambda x: x <= M // N, enum_divisors(M))
print(max(divs))
from collections import deque

H, W = list(map(int,input().split()))
s = []
for i in range(H):  s.append(input())

dx = [0, 1, -1, 0]
dy = [1, 0, 0, -1]
           
def bfs(sx, sy):
    q = deque([])
    d = [[-1 for _ in range(W)] for _ in range(H)]
    q.append([sx, sy])
    d[sy][sx] = 0
    
    while(q):
        pop = q.popleft()
        x, y = pop[0], pop[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < W and ny >= 0 and ny < H:
                if s[ny][nx] != "#" and d[ny][nx] == -1:
                    q.append([nx, ny])
                    d[ny][nx] = d[y][x] + 1
    return d

def max_dim2(d):
    ret = 0
    for i in range(len(d)):
        for j in d[i]:
            ret = max(ret, j)
    return ret

ans = 0
for i in range(H):
    for j in range(W):
        if d[i][j] == ".":
            ret = bfs(j, i)
            temp = max_dim2(ret)
            ans = max(ans, temp)
print(ans)    

### FIXED CODE ###

from collections import deque

H, W = list(map(int,input().split()))
s = []
for i in range(H):  s.append(input())

dx = [0, 1, -1, 0]
dy = [1, 0, 0, -1]
           
def bfs(sx, sy):
    q = deque([])
    d = [[-1 for _ in range(W)] for _ in range(H)]
    q.append([sx, sy])
    d[sx][sy] = 0
    
    while(q):
        pop = q.popleft()
        x, y = pop[0], pop[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if 0 <= nx and nx < H and ny >= 0 and ny < W:
                if s[nx][ny] != "#" and d[nx][ny] == -1:
                    q.append([nx, ny])
                    d[nx][ny] = d[x][y] + 1
    return d

def max_dim2(d):
    ret = 0
    for i in range(len(d)):
        for j in d[i]:
            ret = max(ret, j)
    return ret

ans = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == ".":
            ret = bfs(i, j)
            temp = max_dim2(ret)
            ans = max(ans, temp)
print(ans)
n=int(input())
a=list(map(int,input().split()))
x=[0,0,0]
count=1
for i in range(n):
  if x[0]==0 and a[i]==0:
    x[0]+=1
    count*=3
  elif x[1]==0 and a[i]==0:
    x[1]+=1
    count*=2
  elif x[2]==0 and a[i]==0:
    x[2]+=1
    count*=1
  else:
    count*=x.count(a[i])
    x[x.index(a[i])]+=1
print(count%(10**9+7))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
x=[0,0,0]
count=1
mod=10**9+7
for i in range(n):
  if x[0]==0 and a[i]==0:
    x[0]+=1
    count=count*3
  elif x[1]==0 and a[i]==0:
    x[1]+=1
    count=count*2
  elif x[2]==0 and a[i]==0:
    x[2]+=1
    count=count*1
  else:
    if x.count(a[i])==0:
      count=0
      break
    else:
      count=count*x.count(a[i])
      x[x.index(a[i])]+=1
print(count%mod)
N, x = map(int, input().split())
A = list(map(int, input().split()))
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)

### FIXED CODE ###

N, x = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
  s = A[i] + A[i + 1] - x
  ans += max(0, s)
  if s > 0:
    if s <= A[i + 1]:
      A[i + 1] -= s
    else:
      A[i + 1] = 0
print(ans)
N = int(input())

tprev = 0
xprev = 0
yprev = 0

result = 'YES'

for i in range(N):
    t, x, y = map(int, input())

    xlen = x - xprev
    ylen = y - yprev
    
    time = t - tprev

    length = xlen + ylen

    if time%2 == length%2 and time >= length:
        tprev = t
        xprev = x
        yprev = y

    else:
        result = 'NO'
        break
print(result)


### FIXED CODE ###

N = int(input())

tprev = 0
xprev = 0
yprev = 0

result = 'Yes'

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

    xlen = abs(x - xprev)
    ylen = abs(y - yprev)
    
    time = t - tprev

    length = xlen + ylen

    if time%2 == length%2 and time >= length:
        tprev = t
        xprev = x
        yprev = y

    else:
        result = 'No'
        break
print(result)
import sys
import fractions
input = sys.stdin.readline
import heapq


def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A_sorted = sorted(set(A))

    if len(A) == 2:
        print(max(A))
        exit()

    min = 10 ** 10
    min_index = -1
    for i in range(N - 1):
        x = fractions.gcd(A_sorted[i], A_sorted[i + 1])
        if min > x:
            min = x
            min_index = i

    gcd = A_sorted[0]
    if min_index == 0:
        gcd = A_sorted[2]

    for i in range(N):
        if i == min_index or i == min_index + 1:
            continue
        gcd = fractions.gcd(gcd, A_sorted[i])

    x = fractions.gcd(gcd, A_sorted[min_index])
    y = fractions.gcd(gcd, A_sorted[min_index + 1])

    print(max([x, y]))

if __name__ == '__main__':
    main()



### FIXED CODE ###

import sys
import fractions
input = sys.stdin.readline
import heapq

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    A_sorted = sorted(A)
    div0 = make_divisors(A_sorted[0])
    ans = 1
    for d in div0[1:]:
        count = 0
        isAns = True
        for i in A_sorted[1:]:
            if i % d != 0:
                count += 1
                if count == 2:
                    isAns = False
                    break
        if isAns:
            ans = max(ans, d)
    div1 = make_divisors(A_sorted[1])
    for d in div1[1:]:
        count = 0
        isAns = True
        for i in A_sorted[2:]:
            if i % d != 0:
                isAns = False
                break
        if isAns:
            ans = max(ans, d)

    print(ans)

if __name__ == '__main__':
    main()
Pi = 3.14159265
R = int(input())
M = 2 * R * Pi
E = R ** 2 * Pi
"""
print("{:.10}".format(M))
print("{:.10}".format(E))
"""
print(M)
print(E)


### FIXED CODE ###

import math

r = float(input())
print("{} {}".format(r ** 2 * math.pi, r * 2 * math.pi))
import math
def sks(a,b):
    return (a*b)//math.gcd(a,b)

c=int(input())
result=1
for a in range(c):
    result=sks(result,int(input()))
print(result)

### FIXED CODE ###

import fractions
def sks(a,b):
    return (a*b)//fractions.gcd(a,b)
c=int(input())
result=1
for a in range(c):
    result=sks(result,int(input()))
print(result)
lis = [input() for _ in range(3)]
len = [len(lis[i]) for i in range(3)]
idx = [0,0,0]
name = ['a','b','c']

turn = 0
while 1:
  if len[turn] <= idx[turn]:
     print(name(turn))
    exit()
  else:
    tmp = ord(lis[turn][idx[turn]])-ord('a')
    idx[turn] += 1
    turn = tmp


### FIXED CODE ###

lis = [input() for _ in range(3)]
len = [len(lis[i]) for i in range(3)]
idx = [0,0,0]
name = ['A','B','C']

turn = 0
while 1:
  if len[turn] <= idx[turn]:
    print(name[turn])
    exit()
  else:
    tmp = ord(lis[turn][idx[turn]])-ord('a')
    idx[turn] += 1
    turn = tmp
import numpy as np
N = int(input())

cnt = np.zeros((N,N))

for x in map(str,range(1,N+1)):
    cnt[int(x[0]),int(x[-1])] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i,j] * cnt[j,i]

print(int(ans))

### FIXED CODE ###

N = int(input())

cnt = [[0] * 10 for _ in range(10)]

for i in range(1,N+1):
    x = i
    while x >= 10:
        x //= 10
    cnt[x][i%10] += 1

ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += cnt[i][j] * cnt[j][i]

print(ans)
c,d = map(int,input().split())

if (c+d)%2 == 0:
    print(c+d)//2
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

c,d = map(int,input().split())

if (c+d)%2 == 0:
    print((c+d)//2)
else:
    print('IMPOSSIBLE')
A,B,M = map(int, input().split())

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]

print(min(d))

### FIXED CODE ###

h = input()
l = len(h)
n = 0
hitachi = False

if l % 2 == 1:
  hitachi = False
  
else:
  m = int(l / 2)
  for i in range(m):
    if h[(2 * i)] == "h":
      n += 1
    if h[(2 * i)+1] == "i":
      n += 1
  
  if n == l:
    hitachi = True
  else:
    hitachi = False
    
if hitachi:
  print("Yes")
else:
  print("No")
N = int(input())
S = input()
T = list()
for i in range(int(N / 2), N):
    t = S[i]
    T.append(t)
y = 0
n = 0
for i, k in zip(T, S):
    if i == k:
        y += 1
    else:
        n += 1
if N % 2 != 0:
    print('No')
elif y == int(N / 2):
    print('Yes') 
else:
    print('No')          
   
     


### FIXED CODE ###

r = int(input())
print(r ** 2)
n,x=[int(i) for i in input().split()]
A=["B","P","B"]
B=["P","P"]
for i in range(n):
    ans=A[0]+B[0]+A[1]+B[1]+A[2]
    B[0]=ans
    B[1]=ans
result=0
for i in range(x):
    if ans[i]=="P":
        result+=1
print(result)

### FIXED CODE ###

n,x=[int(i)  for i in input().split()]
a=[1]
p=[1]
for i in range(n):
    a.append(a[i]*2+3)
    p.append(p[i]*2+1)
def f(n,x):
    if n==0:
        if x==0:
            return 0
        else:
            return 1
    elif n>=1:
        if x==1:
            return 0
        elif 1<x<=1+a[n-1]:
            return f(n-1,x-1)
        elif x==a[n-1]+2:
            return p[n-1]+1
        elif 2+a[n-1]<x<=2*a[n-1]+2:
            return p[n-1]+1+f(n-1,x-2-a[n-1])
        else:
            return 2*p[n-1]+1

print(f(n,x))
A, B, C, X = map(int, input().split())
I = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if 500 * i + 100 * j + 50 * k == X:
			I++
print(I)


### FIXED CODE ###

A=int(input())
B=int(input())
C=int(input())
X=int(input())

ans = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            if 500 * a + 100 * b + 50 * c == X:
                ans += 1

print(ans)
import math
r = input()
r = int(r)
S = math.pi * r * r
L = 2 * math.pi * r
print("{0} {1}".format(round(S,6), round(L,6)))

### FIXED CODE ###

import math
r = input()
r = float(r)
S = math.pi * r * r
L = 2 * math.pi * r
print("{0} {1}".format(round(S,6), round(L,6)))
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
print(T-k)

### FIXED CODE ###

h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
else:
  mk=m2+60-m1
  T=mk+(h2-h1-1)*60
print(T-k)
N, Y = map(int, input().split())
man = -1
gosen = -1
sen = -1
flag=0
for i in range(0, N+1):
    if output_flag==1:
        break
    for j in range(0, N+1-i):
        k = N-i-j
        total = 10000*i+5000*j+1000*k
        if total==Y:
            output_flag=1
            man = i
            gosen = j
            sen = k
            break
print(man, gosen, sen)

### FIXED CODE ###

N, Y = map(int, input().split())
man = -1
gosen = -1
sen = -1
for i in range(0, N+1):
    for j in range(0, N+1-i):
        k = N-i-j
        total = 10000*i+5000*j+1000*k
        if total==Y:
            man = i
            gosen = j
            sen = k
print(man, gosen, sen)
S = int(input())
flag = 0

for i in range(3):
    if S[i] == S[i+1]:
        flag += 1

if flag:
    print('Bad')
else:
    print('Good')


### FIXED CODE ###

S = input()
flag = 0

for i in range(3):
    if S[i] == S[i+1]:
        flag += 1

if flag:
    print('Bad')
else:
    print('Good')
n,m=map(int,input().split())
nexts=[None for i in range(n)]
for i in range(n):
  a,b=map(int,input().split())
  a,b=a-1,b-1
  if nexts[a]==None:
    nexts[a]=[b]
  else:
    nexts[a].append(b)
  if nexts[b]==None:
    nexts[b]=[a]
  else:
    nexts[b].append(a)

ans=0
stack=[]
stack.append([0,[]])
while stack:
  node=stack.pop()
  v=node[0]
  seen=node[1]
  seen.append(v)
  if len(seen)==n:
    ans+=1
    continue
  childs=nexts[v]
  if childs:
    for child in (set(childs)-seen):
      stack.append([child,seen])
  
print(ans)


### FIXED CODE ###

n,m=map(int,input().split())
nexts=[None for i in range(n)]
for i in range(m):
  a,b=map(int,input().split())
  a,b=a-1,b-1
  if nexts[a]==None:
    nexts[a]=[b]
  elif b not in nexts[a]:
    nexts[a].append(b)
  if nexts[b]==None:
    nexts[b]=[a]
  elif a not in nexts[b]:
    nexts[b].append(a)

ans=0
stack=[]
stack.append([0,[]])
while stack:
  node=stack.pop()
  v=node[0]
  seen=node[1][:]
  seen.append(v)
  if len(seen)==n:
    ans+=1
    continue
  childs=nexts[v]
  if childs:
    for child in (set(childs)-set(seen)):
      stack.append([child,seen])
  
print(ans)
n = int(input())
test = []
count = 0
for i in range(0, n):
    num_test = int(input())
    for j in range(0, num_test):
        answer = input().split()
        a = answer[1]
        if a == '1':
            count += 1
        else:
            continue
print(count)
return 1

### FIXED CODE ###

n = int(input())
s_dict = {}
for i in range(n):
  add_dict = {}
  a = int(input())
  for j in range(a):
    b = list(map(int, input().split()))
    add_dict[b[0]-1] = b[1]
  s_dict[i] = add_dict
max_num = 0

def rec_get_list(i, tmp_num_list, tmp_honest, tmp_unkind):
  add_dict = s_dict[i]
  tmp_num_list.add(i)
  tmp_honest.add(i)
  for k, v in add_dict.items():
      if v:
        if k not in tmp_num_list:
        	tmp_num_list, tmp_honest, tmp_unkind = rec_get_list(k, tmp_num_list, tmp_honest, tmp_unkind)
        tmp_honest.add(k)
      else:
        tmp_unkind.add(k)
  return tmp_num_list, tmp_honest, tmp_unkind

def rec_check(i, tmp_num_list, tmp_honest, tmp_unkind):
  global max_num
  global n
  for j in range(i, n):
    if j in tmp_num_list:
      continue
    use_num_list = tmp_num_list.copy()
    use_honest = tmp_honest.copy()
    use_unkind = tmp_unkind.copy()
    use_num_list, use_honest, use_unkind = rec_get_list(j, use_num_list, use_honest, use_unkind)
    check_flg = len(use_honest & use_unkind)
    if check_flg:
      continue
    else:
      if len(use_num_list) > max_num:
        max_num = len(use_num_list)
    if j+1 < n:
      rec_check(j+1, use_num_list, use_honest, use_unkind)
  
rec_check(0, set(), set(), set()) 
    
print(max_num)
N, K = map(int, input().split())
[*h] = map(int, input().split())
dp = [float('inf') for _ in range(N)]
dp[0] = 0
for i in range(N):
    dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]) for j in range(1, min(i, K)+1))
 
print(dp[N-1])

### FIXED CODE ###

import numpy as np
N, K = map(int, input().split())
h = np.array(list(map(int, input().split())))
dp = np.zeros(N, dtype=int)
for i in range(1, N):
  j = max(0, i-K)
  dp[i] = np.min(dp[j:i]+np.abs(h[i]-h[j:i]))
                 
print(dp[N-1])
def main():
    n,x,m = map(int,input().split())
    t = [x]
    k = -1
    for _ in range(n):
        x = x**2 % m
        if x in t:
            k = x
            break
        t.append(x)
    s = t.index(k)
    if s == -1:
        print(sum(t))
        return
    else:
        ans = sum(t[0:s])
        b = t[s:len(t)]
        n -= s
        ans += sum(b) * (n//len(b))
        ans += sum(b[0:n%len(b)])
        print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n,x,m = map(int,input().split())
    if m == 0:
        print(0)
        return
    t = [x]
    k = -1
    for _ in range(n-1):
        x = x**2 % m
        if x in t:
            k = x
            break
        t.append(x)
    if k not in t:
        print(sum(t))
        return
    else:
        s = t.index(k)
        ans = sum(t[0:s])
        b = t[s:len(t)]
        n -= s
        ans += sum(b) * (n//len(b))
        ans += sum(b[0:n%len(b)])
        print(ans)

if __name__ == "__main__":
    main()
K,N = int(input().split())
h = [int(input()) for i in range(N)]


list2=list()

h.sort()

for i in range(N-K):
    list2.append(h[i+K]-h[i+1])
    continue
print(min(list2))

### FIXED CODE ###

N, K = map(int, input().split())
h = [int(input()) for i in range(N)]

list2=list()
h.sort()

for i in range(N-K+1):
    list2.append(h[i+K-1]-h[i])
    continue
print(min(list2))
#n=int(input())
#li=input().split()
#d=["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"]
#import numpy as np
#import math
#li=list(map(int,input().split()))
#S=input()

lis=[[],[]]
for i in range(5):
    s=int(input())
    lis[0].append(s)
    lis[1].append(s%10)
for i in range(5):
    if lis[1][i]!=0:
        m=i
        break
for i in range(5):
    if lis[1][m]>lis[1][i] and lis[1][i]!=0:
        m=i
ans=0
for i in range(5):
    if i!=m:
        if lis[1][i]!=0:
            ans+=(lis[0][i]-lis[1][i]+10)
        else:
            ans+=lis[0][i]
ans+=lis[0][m]
print(ans)


### FIXED CODE ###

#n=int(input())
#li=input().split()
#d=["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"]
#import numpy as np
#import math
#li=list(map(int,input().split()))
#S=input()

lis=[[],[]]
for i in range(5):
    s=int(input())
    lis[0].append(s)
    lis[1].append(s%10)
for i in range(5):
    if lis[1][i]!=0:
        m=i
        break
m=0
for i in range(5):
    if lis[1][m]>lis[1][i] and lis[1][i]!=0:
        m=i
ans=0
for i in range(5):
    if i!=m:
        if lis[1][i]!=0:
            ans+=(lis[0][i]-lis[1][i]+10)
        else:
            ans+=lis[0][i]
ans+=lis[0][m]
print(ans)
import sys
s = sys.stdin.readline().rstrip()
if sum([y for y in s if y == 'o']) >= 8:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

import sys
s = sys.stdin.readline().rstrip()
if len([y for y in s if y == 'x']) >= 8:
  print('NO')
else:
  print('YES')
X, Y = map(int, input().split())

c = 0
check = 0
X_k, Y_k = X, Y
while c < max([X, Y]):
    if (X_k / 2) == Y_k:
        check = 1
        c_r = Y_k
        break
    else:
        X_k -= 1
        Y_k -= 2
        c += 1

if ((X + Y) % 3) != 0:
    print(0)
else:
    N = c + c_r
    r = min([c, c_r])
    fact = [1, 1]
    inv = [0, 1] 
    factinv = [1, 1]
    p = 10 ** 9 + 7
    for i in range(2, N+1):
        fact.append(fact[-1] * i % p)
        inv.append(-inv[p%i] * (p // i) % p)
        factinv.append(factinv[-1] * inv[-1] % p)
    print(fact[N] * factinv[r] * factinv[N-r] % p)

### FIXED CODE ###

import sys

X, Y = map(int, input().split())

n = (2*Y-X) / 3
m = (2*X-Y) / 3

if (X + Y) % 3 != 0 or n < 0 or m < 0:
    print(0)
    sys.exit(0)

N = int(n + m)
r = int(min([n, m]))
p = 10**9 + 7
fact = [1, 1]
inv = [0, 1]
factinv = [1, 1]

for i in range(2, N+1):
    fact.append(fact[-1]*i % p)
    inv.append(-inv[p%i] * (p//i) % p)
    factinv.append(factinv[-1] * inv[-1] % p)

print(fact[N] * factinv[r] * factinv[N-r] % p)
N,K=map(int,input().split())
import math
def d(n,r):
  return math.factorial(n)//math.factorial(r)//math.factorial(n-r)

if N<K:
  print(0)
else:  
  a=N//K
  ans=a
  if K%2==1:
    if a>=2:
      ans+=d(a,2)*6
    if a>=3:
      ans+=a*(a-1)*(a-2)
    print(ans)
  else:    
    if K*a+K//2<=N:
      b=a+1
    if a>=2:
      ans+=d(a,2)*6
      print(ans)
    if a>=3:
      ans+=a*(a-1)*(a-2)
    if b>=2:
      ans+=b+d(b,2)*6
    if b>=3:
      ans+=b*(b-1)*(b-2)

    print(ans)


### FIXED CODE ###

N,K=map(int,input().split())
a=N//K
if K%2==1:
  print(a**3)
else:
  if N>=(a+0.5)*K:
    print(a**3+(a+1)**3)
  else:
    print((a**3)*2)
a,b=map(int,input().split())
if a>b:
    print("Alice")
elif a=b:
    print("Draw")
else:
    print("Bob")

### FIXED CODE ###

a,b=map(int,input().split())
if a==1:a=14
if b==1:b=14
if a>b:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")
import numpy as np

S = input()
mod = 10**9 + 7
dp = np.zeros(13)
dp[0] = 1

M = np.zeros((13, 13))
for i in range(13):
    for d in range(10):
        M[i][(i * 10 + d) % 13] += 1

for i in range(len(S)):
    ndp = np.zeros(13)
    if S[i] == '?':
        ndp = np.matmul(dp, M)
    else:
        d = int(S[i])
        for j in range(13):
            ndp[(j * 10 + d) % 13] += dp[j]
    dp = ndp % mod

print(int(dp[5]))


### FIXED CODE ###

import numpy as np
 
s = input()
p = np.array([0]*13)
p[0] = 1
 
amari = [[0]*13 for _ in range(13)]
for j in range(10):
  for i in range(13):
    amari[i][(i*10+j)%13] += 1
M = np.array(amari)
 
for si in range(len(s)):
  a = np.array([0]*13)
  if s[si] == '?':
    a = np.dot(p,M)
  else:
    c = int(s[si])
    for i in range(13):
      a[(i*10+c)%13] += p[i]
  p = np.mod(a,1000000007)
print(p[5])
x = int(input)

x**3

### FIXED CODE ###

x = int(input())
print(x**3)
s=(input)
print("YES" if s[0]==s[2] else "No")

### FIXED CODE ###

s=input()
print("Yes" if s[0]==s[2] else "No")
import sys

a,b = [input() for i in range(2)]

length = abs(len(a)-len(b))

for i in range(length+1):
    right_length = length - i
    temp = '?'*i+b+'?'*right_length
    
    #判定
    judge = 0
    for j in range(len(a)):
        if a[j] == temp[j] or temp[j] == '?':
            judge += 1
        elif temp[j] != '?' and a[j] == '?':
            judge += 1
    if judge == len(a):
        S = ''
        for k in range(len(temp)):
            if temp[k] == '?':
                S += a[k]
            else:
                S += temp[k]
        
        print(S.replace('?','a'))
        sys.exit()


print('UNRESTORABLE')


### FIXED CODE ###

a = input()
b = input()

length = len(a) - len(b) + 1

ans = []
for i in range(length):
    A = list('?'*i+b+'?'*(length-i-1))
    flag = True
    for j in range(len(a)):
        if a[j] == '?' or a[j] == A[j]:
            pass
        elif a[j] != '?' and A[j] == '?':
            A[j] = a[j]
        else:
            flag = False
    if flag:
        ans.append(''.join(A).replace('?','a'))

if ans:
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')