Harryxun/stf_run huggingface dataset:
n, m, k = map(int, input().split())

candidates = [0] * n
friends = [0] * n
blocks = [0] * n
parent = [i for i in range(n + 1)]
sizes = [1] * (n + 1)

def root(x):
    global parent
    if parent[x] == x:
        return x
    else:
        parent[x] = root(parent[x])
        return parent[x]

def unite(x, y):
    global parent
    global sizes
    x = root(x)
    y = root(y)
    if x == y:
        return
    parent[y] = x # ここがREの原因らしいが..
    sizes[x] += sizes[y]
    sizes[y] = sizes[x]

def same(x, y):
    return root(x) == root(y)

for _ in range(m):
    a, b = map(int, input().split())
    friends[a - 1] += 1
    friends[b - 1] += 1
    unite(a - 1, b - 1)

for _ in range(k):
    c, d = map(int, input().split())
    if same(c - 1, d - 1):
        blocks[c - 1] += 1
        blocks[d - 1] += 1

for i in range(n):
    candidates[i] = sizes[root(i)] - friends[i] - blocks[i] - 1

print(*candidates)


### FIXED CODE ###

class UnionFind:
    def __init__(self, n):
        self.parents = [i for i in range(n + 1)]
        self.sizes = [1] * (n + 1)

    def find(self, x):
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if y < x:
            x, y = y, x
        self.parents[y] = x
        self.sizes[x] += self.sizes[y]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        return self.sizes[self.find(x)]


n, m, k = map(int, input().split())
uf = UnionFind(n)
friends = [0] * n
blocks = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    friends[a - 1] += 1
    friends[b - 1] += 1
    uf.unite(a - 1, b - 1)
for i in range(k):
    c, d = map(int, input().split())
    if uf.same(c - 1, d - 1):
        blocks[c - 1] += 1
        blocks[d - 1] += 1
ans = [0] * n
for i in range(n):
    ans[i] = uf.size(i) - friends[i] - blocks[i] - 1
print(*ans)
mod = 10**9 + 7
n = int(input())
lx = list(map(int, input().split()))

from math import factorial as kj

d = 0
ans = 0

for i in range(1, n):
  d = (d * i + kj(i-1)) % mod
  ans = (ans * i + (lx[i] - lx[i-1]) * d) % mod

print(ans)

### FIXED CODE ###

n = int(input())
l = [input().split() for _ in range(n)]
x = input()

flg = 0
ans = 0
for s, t in l:
    if flg == 1:
        ans += int(t)
    if s == x:
        flg = 1
print(ans)
c1 = input()
c2 = input()
c2 = c2[::-1]

import sys
for (a, b) in zip(c1, c2):
    if a != b:
        print('NO')
        sys.exit(1)

print('YES')


### FIXED CODE ###

c1 = input()
c2 = input()
c2 = c2[::-1]

import sys
for (a, b) in zip(c1, c2):
    if a != b:
        print('NO')
        sys.exit(0)

print('YES')
n = input()
inf = 1000000000
M = [[inf for i in range(n)] for i in range(n)]
for i in range(n):
  str = raw_input().split()
  u = int(str[0])
  k = int(str[1])
  for j in range(k):
    v = str[2+j]
    c = str[3+j]
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]

d[0] = 0
color[0] = 1

while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
    print minv
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])

### FIXED CODE ###

n = input()
inf = 1000000000
M = [[inf for i in range(n)] for i in range(n)]
for i in range(n):
  str = map(int, raw_input().split())
  u = str[0]
  k = str[1]
  for j in range(k):
    v = str[2+2*j]
    c = str[3+2*j]
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]
 
d[0] = 0
color[0] = 1
 
while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])
L, R = map(int, input().split())

num_list = list(range(L, R + 1))

num_list = [i % 2019 for i in num_list]
num_list.sort()

print((num_list[0] * num_list[1]) % 2019)


### FIXED CODE ###

L, R = map(int, input().split())
if (L <= 673 <= R and R - L >= 3) or (R - L >= 673):
    print(0)
else:
    mods = []
    mods_append = mods.append
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            m = (i * j) % 2019
            mods_append(m)
            if m == 2:
                break

    print(min(mods))
import sys
for line in sys.stdin:
    N = int(raw_input())
    ans = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == N:
                        ans += 1
    print ans

### FIXED CODE ###

import sys
for line in sys.stdin:
    N = int(line)
    ans = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == N:
                        ans += 1
    print ans
a,b=map(int,input().split())
if a %3==0 or b%3== or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

a, b = map(int, input().split())
if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
N = int(input())
K = int(input())
x = list(map(int,input().split()))
L = 0
for i in range(N):
  if K - x[i] <= x[i]:
    L = L + x[i]
  else:
    L = K -x[i]
print (2 * L)

### FIXED CODE ###

N = int(input())
a = int(input())
print (N *N - a)
import sys
def input():
	return sys.stdin.readline()[:-1]
n, s = map(int, input().split())
a = list(map(int, input().split()))
MOD = 998244353
dp = [0 for _ in range(s+1)]
dp[0] = 1
ans = 0
for i in range(n):
	for j in range(s, a[i]-1, -1):
		dp[j] += dp[j-a[i]]
		dp[j] %= MOD
	dp[a[i]] += i
	dp[a[i]] %= MOD
	ans += dp[s]
	ans %= MOD
print(ans)

### FIXED CODE ###

import sys
def input():
	return sys.stdin.readline()[:-1]
n, s = map(int, input().split())
a = list(map(int, input().split()))
MOD = 998244353
dp = [0 for _ in range(3001)]
dp[0] = 1
ans = 0
for i in range(n):
	for j in range(s, a[i]-1, -1):
		dp[j] += dp[j-a[i]]
		dp[j] %= MOD
	dp[a[i]] += i
	dp[a[i]] %= MOD
	ans += dp[s]
	ans %= MOD
print(ans)
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
manzoku=0
dish_b=100
for i in range(n):
    dish=a[i]
    manzoku+=b[dish-1]
    if dish==dish_b+1:
        manzoku+=c[dish_b-1]
    dish_b=dish
print(manzoku)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
manzoku=0
dish_b=100
for i in range(n):
    dish=a[i]
    manzoku+=b[dish-1]
    if dish==dish_b+1:
        manzoku+=c[dish_b-1]
    dish_b=dish
print(manzoku)
,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
if abs(a-c)<=d:
        print('Yes')
else:
        print("No")


### FIXED CODE ###

a,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
        else:
                print("No")
elif abs(a-c)<=d:
        print("Yes")
else:
        print("No")
package main

import (
	"fmt"
	"math"
)

func main() {
	var A, B int
	fmt.Scan(&A)
	fmt.Scan(&B)
	if (A + B) % 2 == 0 {
		fmt.Println((A + B) / 2)
	} else {
		fmt.Println("IMPOSSIBLE")
	}
}


### FIXED CODE ###

A, B = [int(i) for i in input().split(" ")]
if (A + B) % 2 == 0: print((A + B) // 2)
else: print("IMPOSSIBLE")
input_num = map(int, input().split())
seki = input_num[0] * input_num[1]
if seki % 2 == 0:
    print("EvenW\")
else:
    print("Odd")

### FIXED CODE ###

num1, num2 = map(int, input().split())
seki = num1 * num2
if seki % 2 == 0:
    print("Even")
else:
    print("Odd")
return input().strip().split().index("0") + 1

### FIXED CODE ###

print(input().strip().split().index("0") + 1)
n,x = map(int,input().split())
a = list(map(int,input().split()))

s = a[0] + a[1]
s.append(0)
p = 0
if a[0] > x:
    a[0] = x
    p = a[0] - x
    
for i in range(0,n):
    pp = a[i] + a[i + 1]
    if pp > x:
        a[i+1] = a[i+1] - pp + x
        p = p + pp -x
        
print(p)
    

### FIXED CODE ###

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

b = [0]
for i in range(n):
    b.append(a[i])
b.append(0)    
counter = 0

if b[1] > x:
    counter = b[1] - x
    b[1] = x
for i in range(n+1):
    if b[i] + b[i+1] > x:
        s = b[i] + b[i+1] - x
        if b[i+1] - s > -1:
            b[i+1] = b[i+1] -s
            counter = counter + s
        else:
            k = b[i+1]
            counter = counter + s
            b[i+1] = 0
            b[i] = x
        
print(counter)
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, A = nl()
X = nl()

dp = []
for i in range(N+1):
    r = []
    for j in range(N+1):
        r.append([0 for k in range(N*max(X)+1)])
    dp.append(r)

dp[0][0][0] = 1
for i in range(1, N+1):
    for j in range(0, N+1):
        for k in range(N*max(X)+1):
            if k < X[i-1]:
                dp[i][j][k] = dp[i-1][j][k]
            elif j > 0 and k >= X[i-1]:
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-X[i-1]]

total = 0
for k in range(1, N+1):
    total += dp[N][k][k*A]
print(total)




### FIXED CODE ###

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N, A = nl()
X = nl()

dp = []
for i in range(N+1):
    r = []
    for j in range(N+1):
        r.append([0 for k in range(N*50+1)])
    dp.append(r)

dp[0][0][0] = 1
for i in range(1, N+1):
    for j in range(0, N+1):
        for k in range(N*50+1):
            if k < X[i-1]:
                dp[i][j][k] = dp[i-1][j][k]
            elif j > 0 and k >= X[i-1]:
                dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][k-X[i-1]]

total = 0
for k in range(1, N+1):
    total += dp[N][k][k*A]
print(total)
S = input()
n = len(S)
ans = 0
l = 0
r = 0
for i in range(n - 1):
    if S[i] == '>' and S[i + 1] == ('<'):
        temp = i
        break
if S[0] == '<':
    temp = 0
ans += temp * (temp + 1) // 2
i = temp

while(i < n):
    while (i < n and S[i] == '<'):
        l += 1
        i += 1
    while (i < n and S[i] == '>'):
        r += 1
        i += 1
    l, r = min(l, r), max(l, r)
    ans += l * (l - 1) // 2 + r * (r + 1) // 2
    l = 0
    r = 0

print(ans)

### FIXED CODE ###

S = input()
n = len(S)
S = S + " "
ans = 0
l = 0
r = 0
temp = 0

if S[0] == '<':
    temp = 0
else:
    for i in range(n):
        if S[i] == '>' and S[i + 1] == ('<'):
            temp = i+1
            break
        if i == n - 1:
            print((n + 1) * n // 2)
            exit()
ans += (temp) * (temp + 1) // 2
i = max(temp, 0)

while(i < n):
    while (i < n and S[i] == '<'):
        l += 1
        i += 1
    while (i < n and S[i] == '>'):
        r += 1
        i += 1
    l, r = min(l, r), max(l, r)
    ans += l * (l - 1) // 2 + r * (r + 1) // 2
    l = 0
    r = 0

l, r = min(l, r), max(l, r)
ans += l * (l - 1) // 2 + r * (r + 1) // 2
print(ans)
N,K=map(int,input().split())
sunuke=[]
for i in range(K):
    d=int(input())
    okashi=input().split()
    for i in range(d):
        sunuke.append(okashi[i])

have_okashi=collections.Counter(sunuke)
print(N-len(have_okashi))


### FIXED CODE ###

import collections
N,K=map(int,input().split())
sunuke=[]
for i in range(K):
    d=int(input())
    okashi=input().split()
    for i in range(d):
        sunuke.append(okashi[i])

have_okashi=collections.Counter(sunuke)
print(N-len(have_okashi))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

# from functools import reduce
# from math import gcd as gcd_base  # from fractions import gcd
# gcd = lambda *numbers: reduce(gcd_base, numbers)  # 3 数以上の最大公約数

# lcm_base = lambda x, y: (x * y) // gcd_base(x, y)
# lcm = lambda *numbers: reduce(lcm_base, numbers, 1)  # 3 数以上の最小公倍数
# 最小公倍数
# def gcd(a, b):
#     if a < b:
#         a, b = b, a
#     while a % b != 0:
#         a, b = b, a % b
#     return b


## 最大公約数 
def lcm(a, b):
    y = a*b / gcd(a, b)
    return int(y)

def many_lcm(l):
    for i in range(len(l)-1):
        if i == 0:
            ans = lcm(l[0], l[1])
        else:
            ans = lcm(l[i+1], ans)
    return ans
N = INT()
A = LIST()

lm = many_lcm(A)
# print(l)
B = []
for a in A:
    B.append(lm // a)
print(sum(B) % mod)




### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

# from functools import reduce
# from math import gcd as gcd_base  # from fractions import gcd
# gcd = lambda *numbers: reduce(gcd_base, numbers)  # 3 数以上の最大公約数

# lcm_base = lambda x, y: (x * y) // gcd_base(x, y)
# lcm = lambda *numbers: reduce(lcm_base, numbers, 1)  # 3 数以上の最小公倍数
# 最小公倍数
# def gcd(a, b):
#     if a < b:
#         a, b = b, a
#     while a % b != 0:
#         a, b = b, a % b
#     return b



def many_lcm(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = tmp * l[i]//gcd(tmp, l[i])
    return tmp
N = INT()
A = LIST()

lm = many_lcm(A)
ans = 0
for a in A:
    ans += lm // a
    
print(ans % mod)
a, b = map(int, input().split())
if (a*b) % 2==0
    print("Odd")
else:
    print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
K = int(input())

if K%2 == 0 or K%5 ==0:
    print(-1)
    sys.exit()
    
N = 7
count = 0
i = 1

while i:
    
    count += 1
    if N % K == 0:
        print(count)
        sys.exit()
    N = N*10 + 7

### FIXED CODE ###

K = int(input())

N = 0
count = -1

for i in range(K):
    N = (N*10+7)%K
    if N == 0:
        count = i+1
        break
    
print(count)
import sys
import os
import math
f = open('test01.txt', 'r')
sys.stdin = f

n,x,t = map(int,input().split())
print(math.ceil(n/x)*t)

### FIXED CODE ###

import math

n,x,t = map(int,input().split())
print(math.ceil(n/x)*t)
x=int(input())
t=int(input())
if(x-t>=0):
  print(x-t)
else:
  print(0)

### FIXED CODE ###


x,t=map(int,input().split())
if(x-t>=0):
  print(x-t)
else:
  print(0)
import sys, math
from collections import deque

readline = sys.stdin.readline

A = int(readline())

n = math.floor(math.log10(A)) + 1

count = 0
for i in range(1, n, 2):
    count += 9 * 10 ** (i - 1)

if n % 2 == 1:
    count += A - 10 ** (i - 1) + 1

print(count)

### FIXED CODE ###

import sys, math
from collections import deque

readline = sys.stdin.readline

A = int(readline())

n = math.floor(math.log10(A)) + 1

count = 0
for i in range(1, n, 2):
    count += 9 * 10 ** (i - 1)

if n % 2 == 1:
    count += A - 10 ** (n - 1) + 1

print(count)
#C - Forbidden List
X,N= map(int,input().split())
p= list(map(int,input().split()))
A= list(range(1,X+1))
for i in range(N):
    A.remove(p[i])

D = 101
ans = 0
for j in range(len(A)):
    if D >= abs(X - A[j]):
        D = abs(X - A[j])
        ans = A[j]
    else:
        pass
print(ans)

### FIXED CODE ###

"""#D - Not Divisible
N= map(int,input().split())
A= list(map(int,input().split()))"""


#C - Forbidden List
X,N= map(int,input().split())
p= list(map(int,input().split()))
A= list(range(-200,200))
#print(A)
for i in range(N):
    A.remove(p[i])

D = 201
ans = -100
for j in range(len(A)):
    if D > abs(X - A[j]):
        D = abs(X - A[j])
        ans = A[j]

    else:
        pass
print(ans)
a, b = int(input()).split()
seki = a * b
sekito = seki % 2
if sekito = 1:
  response = 'Odd'
else:
  response = 'Even'
  return response


### FIXED CODE ###

a, b = map(int, input().split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = 'Odd'
else :
  response = 'Even'
print(response)
# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

x,y,a,b,c=MI()
rs=sorted(LI(),reverse=True)
gs=sorted(LI(),reverse=True)
ns=sorted(LI(),reverse=True)
rs=rs[0:x]
gs=gs[0:y]
#print(gs)
R=deque(rs)
G=deque(gs)
N=deque(ns)


u=R.popleft()
v=G.popleft()
w=N.popleft()
if x==1:
    s=u
else:
    s=R.pop()
if y==1:
    t=v
else:
    t=G.pop()
ans=0
while x>0 or y>0:
    if x==0:
        u=0
        s=inf
    if y==0:
        v=0
        t=inf
    if u>v and u>=w:
        #print(u)
        ans+=u
        x-=1
        if x==1:
            u=s
        elif x!=0:
            u=R.popleft()
        
    elif v>u and v>=w:
        #print(v)
        ans+=v
        y-=1
        if y==1:
            v=t
        elif y!=0:
            v=G.popleft()
        
    elif w>u and w>v:
        #print(w)
        ans+=w
        if s<=t:
            if x==1:
                s=u
                x-=1
            elif x!=0:
                s=R.pop()
                x-=1
        else:
            if y==1:
                t=v
                y-=1
            elif y!=0:
                t=G.pop()
                y-=1
print(ans)

### FIXED CODE ###

# coding: utf-8
# hello worldと表示する
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

x,y,a,b,c=MI()
ps=sorted(LI(),reverse=True)
qs=sorted(LI(),reverse=True)
rs=sorted(LI(),reverse=True)
ps=ps[0:x]
qs=qs[0:y]
u=rs+ps+qs
u.sort(reverse=True)
print(sum(u[0:x+y]))
import numpy as np

if __name__=="__main__":
    inputs_number  = lambda : [int(x) for x in input().split()]
    N, Ma, Mb = inputs_number()
    drugs = np.array([inputs_number() for i in range(N)])

    inf = 100*N + 1
    dp = np.ones((N,N*10,N*10)) * inf
    dp[0,0,0] = 0
    for i in range(0, N-1):
	for ca in range(N*10):
            for cb in range(N*10):
		if(dp[i,ca,cb]==inf):
                    continue
		dp[i+1,ca,cb]=np.min([dp[i+1,ca,cb],dp[i,ca,cb]]);
		dp[i+1,ca+drugs[i,0],cb+drugs[i,1]]=np.min([dp[i+1,ca+drugs[i,0],cb+drugs[i,1]],dp[i,ca,cb]+drugs[i,2]]);

    ans = inf
    for i in range(1, N):
	for ca in range(1, N*10):
            for cb in range(1, N*10):
		if(Ma*cb == Mb*ca and dp[i,ca,cb] < ans):
                    ans = dp[i,ca,cb]
    if(ans==inf):
	ans = -1
    print(int(ans))

### FIXED CODE ###

if __name__=="__main__":
    a, b = list(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")
k=int(input())
ans=0
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a
sumlis={}
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            lis=sorted([a,b,c])
            elif lis in sumlis.values(): 
                ans+=sumlis[lis]
            else:
                x=gcdlist(lis)
                sumlis[x]=sumlis
                ans+=x
                
print(ans)

### FIXED CODE ###

k=int(input())
ans=0
import math
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a

sumlis={}
for a in range(1,k+1):
    for b in range(1,k+1):
        t=math.gcd(a,b)
        for c in range(1,k+1):
            ans+=math.gcd(t,c)
                
print(ans)
N=int(input())
tree=[[] for i in range(N)]
for i in range(N-1):
  a,b,c=map(int,input().split())
  tree[a-1].append((b-1,c))
  tree[b-1].append((a-1,c))
depth=[0 for i in range(N)]
def dfs(v,p,d):
  depth[v]=d
  for vv,dd in tree[v]:
    if vv==p:
      continue
    dfs(vv,v,d+dd)
Q,K=map(int,input().split())
dfs(K-1,-1,0)
for i in range(Q):
  x,y=map(int,input().split())
  print(depth[x-1]+depth[y-1])

### FIXED CODE ###

N=int(input())
tree=[[] for i in range(N)]
for i in range(N-1):
  a,b,c=map(int,input().split())
  tree[a-1].append((b-1,c))
  tree[b-1].append((a-1,c))
from collections import deque
visited=[-1 for i in range(N)]
Q,K=map(int,input().split())
visited[K-1]=0
q=deque([])
q.append(K-1)
while q:
  u=q.popleft()
  for v,d in tree[u]:
    if visited[v]==-1:
      visited[v]=visited[u]+d
      q.append(v)
    
for i in range(Q):
  x,y=map(int,input().split())
  print(visited[x-1]+visited[y-1])
print(3*(int(input())**2)

### FIXED CODE ###

r=int(input())
print(3*r**2)