Harryxun/stf_run huggingface dataset:
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

n, k, s = MAP()

# A = [i for i in range(1, s+1)]
# print(A)
# add = []
# A = [i for i in range(1, 10**9+1)]
# for i in range(1, n+1):
#   for j in range(i, n+1):
# のびしろ，これからこれだけのばすよ

L = [ s ] * k
# print(c)

one = []
see = 0
while n-len(L)-len(one) != 0:
  # for i in range(c):  
  #   L.insert(0, 1)
  L[see] = L[see] - 1
  one.append(1)
  if L[see] == 1:
    see +=1
# print(one)

a = one + L
#ans = [1, 2, 3, 4]
print(*a)

### 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

n, k, s = MAP()
 
if s == 10 ** 9:
  a = 1
else:
  a = 10 ** 9

ans = [s] * k + [a] * (n - k)
 
print(*ans)
import math
from copy import copy
di = {}
di[0] = 0
for i in range(1, 2*(10**5)+1):
    di[i] = 0
for i in range(1, 2*(10**5)+1):
    count = 0
    for j in range(int(math.log2(i))+2):
        if (i>>j)&1:
            count += 1
    di[i] = di[i%count] + 1
n = int(input())
x = list(input())
x.reverse()
count = 0
for i in x:
    if i =='1':
        count += 1
mod_p = count + 1
mod_m = count - 1
di_p = {}
di_m = {}
for i in range(n):
    di_p[i] = pow(2, i, mod_p)
    di_m[i] = pow(2, i, mod_m)
s_p = 0
s_m = 0
for i in range(n):
    if x[i] == '1':
        s_p += di_p[i]
        s_m += di_m[i]
for i in range(n-1, -1, -1):
    sm = copy(s_m)
    sp = copy(s_p)
    if x[i] == '1':
        sm -= di_m[i]
        sm %= mod_m 
        print(di[sm]+1)
    else:
        sp += di_p[i]
        sp %= mod_p
        print(di[sp]+1)

### FIXED CODE ###

import math
from copy import copy
di = {}
di[0] = 0
for i in range(1, 2*(10**6)+1):
    di[i] = 0
for i in range(1, 2*(10**6)+1):
    count = 0
    for j in range(int(math.log2(i))+4):
        if (i>>j)&1:
            count += 1
    di[i] = di[i%count] + 1
n = int(input())
x = list(input())
x.reverse()
count = 0
for i in x:
    if i =='1':
        count += 1
mod_p = count + 1
mod_m = count - 1
di_p = {}
di_m = {}
for i in range(n):
    di_p[i] = pow(2, i, mod_p)
    if mod_m >= 1:
        di_m[i] = pow(2, i, mod_m)
s_p = 0
s_m = 0
for i in range(n):
    if x[i] == '1':
        s_p += di_p[i]
        if mod_m >= 1:
            s_m += di_m[i]
    else:
        continue
for i in range(n-1, -1, -1):
    sm = copy(s_m)
    sp = copy(s_p)
    if x[i] == '1' and (mod_m == 0 or mod_m == -1):
        print(0)
    elif x[i] == '1':
        sm -= di_m[i]
        sm %= mod_m 
        print(di[sm]+1)
    else:
        sp += di_p[i]
        sp %= mod_p
        print(di[sp]+1)
a = int(input())
b = int(input())
c = int(input())
k = int(input())
s = 0
while(0 < a and 0 < k):
    s += 1
    k -= 1
    a -= 1
while(0 < b and 0 < k):
    k -= 1
    b -= 1
while(0 < c and 0 < k):
    s -= 1
    k -= 1
    c -= 1
print(s)

### FIXED CODE ###

a, b, c, k = map(int, input().split())
s = 0
if a >= k:
    s = k
elif  a + b >= k:
    s = a
else:
    s = a - (k - a - b) 
print(s)
N = input()
l = input().split()
 
flag = "APPROVED"
for n in l:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))  # 入力のときに N を使う必要はありません

flag = "APPROVED"
for n in A:
  if n % 2 == 0 and n%3 != 0 and n%5 != 0:
    flag = "DENIED"
    
print(flag)
import sys
n , m, *e = map(int,sys.stdin.read().split())
total = n*(n-1)//2
ans =[total]
u = [-1]*(n+1)

def find(x):
    if u[x] < 0 :
        return x
    else:
        return find(u[x])

for x , y in zip(e[-2:1:-2],e[:1:-2]):
    x = find(x)
    y = find(y)
    if x != y:
        total -= u[x] * u[y]
        u[x] += u[y]
        u[y] = x
    ans += [total]

print(*ans[::-1], sep="\n")

### FIXED CODE ###

import sys
n , m, *e = map(int,sys.stdin.read().split())
total = n*(n-1)//2
ans =[total]
u = [-1]*(n+1)

def find(x):
    if u[x] < 0 :
        return x
    else:
        return find(u[x])

for x , y in zip(e[-2:1:-2],e[:1:-2]):
    x = find(x)
    y = find(y)
    x, y = sorted((x, y))
    if x != y:
        total -= u[x] * u[y]
        u[x] += u[y]
        u[y] = x
    ans += [total]

print(*ans[::-1], sep="\n")
a = []
for i in range(5):
	a.append(int(input().split()))
k = int(input().split())

for i in range(4):
  if a[i+1] - a[i] > k :
    print(": (")
    exit()

print("Yay!")

### FIXED CODE ###

a = []
for i in range(5):
	a.append(int(input()))
k = int(input())
 
for i in range(4):
  for j in range(i+1, 5): 
    if a[j] - a[i] > k :
      print(":(")
      exit()
 
print("Yay!")
#!/usr/bin/env python3

N,M =map(int, input().split())
A =list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[M] >= sum(B)//4//M:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N,M =map(int, input().split())
A =list(map(int, input().split()))
B = sorted(A, reverse = True)
if B[M-1] >= sum(B)/4/M:
    print("Yes")
else:
    print("No")
try:
	N, M = map(int,input().split())
	for i in range(1, N+1):
    	f = 2 * i + 4 * (N - i)
    	if f == M:
       		print("Yes")
        	break
	else:
    	print("No")
except EOFError as error:

### FIXED CODE ###

X,Y=map(int,input().split())
m=(4*X-Y)/2
n=(Y-2*X)/2
if (m.is_integer() and m >=0 ) and (n.is_integer() and n>=0):
    print("Yes")
else:
    print("No")
import math

n = int(input())
c = [[0]*2 for i in range(n) ]
a = [0] * n
p = math.pi
for i in range(n):
    c[i][0], c[i][1] = map(float, input().split())

def f(ax, ay, bx, by, cx, cy):
    vx = ax - cx
    vy = ay - cy
    wx = bx - cx
    wy = by - cy
    s = 1
    if vx * wy - vy * wx < 0: s = -1
    p = vx * wx + vy * wy
    q = ( vx * vx + vy * vy ) ** 0.5
    r = ( wx * wx + wy * wy ) ** 0.5
    t=0
    t = (math.acos( p / (q * r) )) * s
    return t

for i in range(n):
    k = (i+1)%n
    tax = 0
    tin = 0
    for j in range(n):
        if j != i and j != k:
            t = f(c[k][0], c[k][1], c[j][0], c[j][1], c[i][0], c[i][1])
            tax = max(tax, t)
            tin = min(tin, t)
    if tax - tin < p:
        a[i] = (p - tax + tin) / (p * 2)

for i in range(n):
    print(a[i])


### FIXED CODE ###

import math

n = int(input())
c = [[0]*2 for i in range(n) ]
a = [0] * n
p = math.pi
for i in range(n):
    c[i][0], c[i][1] = map(float, input().split())

def f(ax, ay, bx, by, cx, cy):
    vx = ax - cx
    vy = ay - cy
    wx = bx - cx
    wy = by - cy
    s = 1
    if vx * wy - vy * wx < 0: s = -1
    p = vx * wx + vy * wy
    q = ( vx * vx + vy * vy ) ** 0.5
    r = ( wx * wx + wy * wy ) ** 0.5
    t = p / (q * r)
    t = max(-1, min(1, t))
    t = (math.acos( t )) * s
    return t

for i in range(n):
    k = (i+1)%n
    tax = 0
    tin = 0
    for j in range(n):
        if j != i and j != k:
            t = f(c[k][0], c[k][1], c[j][0], c[j][1], c[i][0], c[i][1])
            tax = max(tax, t)
            tin = min(tin, t)
    if tax - tin < p:
        a[i] = (p - tax + tin) / (p * 2)

for i in range(n):
    print(round(a[i], 6))
y,m,d = map(int,input().split("/"))

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
    print("TBD")
else:
    print("Heisei")

### FIXED CODE ###

y,m,d = map(int,input().split("/"))

if y >= 2020:
    print("TBD")
elif y == 2019:
    if m >= 5:
        print("TBD")
    else:
        print("Heisei")   
else:
    print("Heisei")
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7
MIN = 100


def org(N, M, dp):
    a = [0] * M

    dp[0] = 1
    dp[1] = 1
    dp[2] = 2
    for i in range(3, max(N+1, MIN)):
        dp[i] = dp[i-1] + dp[i-2]

    ans = 1

    for i in range(M):
        a[i] = int(input())

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print(0)
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= dp[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= dp[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= dp[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= dp[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


def good(N, M, dp):
    a = [0] * N

    for i in range(M):
        a[int(input())-1] = True

    dp[0] = 0 if a[0] is True else 1
    dp[1] = dp[0] + (0 if a[1] is True else 1)
    for i in range(2, N):
        if a[i] is True:
            dp[i] = 0
        else:
            dp[i] = dp[i-1] + dp[i-2]
            dp[i] %= MOD

    print(dp[N-1] % MOD)
    # print(dp)


def main():
    N, M = map(int, input().split())
    dp = [0] * max((N + 1), MIN)

    good(N, M, dp)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, M = map(int, input().split())
    memo = [0] * max((N + 1), 10)
    a = [0] * M

    memo[0] = 1
    memo[1] = 1
    memo[2] = 2
    for i in range(3, max(N+1, 10)):
        memo[i] = memo[i-1] + memo[i-2]

    # print(memo)
    ans = 1

    for i in range(M):
        a[i] = int(input())

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print(0)
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= memo[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= memo[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


if __name__ == '__main__':
    main()
print(input()**3)

### FIXED CODE ###

print(int(input())**3)
n, *A = map(int, open(0).read().split())
if n % 2:
    d = {i:2 for i in range(0, n, 2)}
    d[0] -= 1
else:
    d = {i:2 for i in range(1, n, 2)}
for a in A:
    d[a] -= 1

if any(d.values()):
    print(0)
else:
    print(pow(2, n//2, 10**9 + 7))

### FIXED CODE ###

n, *A = map(int, open(0).read().split())
if n % 2:
    d = {i:2 for i in range(0, n, 2)}
    d[0] -= 1
else:
    d = {i:2 for i in range(1, n, 2)}
for a in A:
    if a in d:
        d[a] -= 1
    else:
        print(0)
        exit()

if any(d.values()):
    print(0)
else:
    print(pow(2, n//2, 10**9 + 7))
a,b,c,d= map(int,imput().split())
if b>=0 and d>=0:
    print(b*d)
elif b>=0 and d<0 and a>=0:
    print(a*d)
elif b>=0 and d<0 and a<0:
    print(a*c)
elif b<0 and d>=0 and c>=0:
    print(b*c)
elif b<0 and d>=0 and c<0:
    print(a*c)
else:
    print(a*c)

### FIXED CODE ###

a,b,c,d= map(int,input().split())
A=max(a*c,a*d,b*c,b*d)
print(A)
A,B = map(int,input().split())
print(A-2*b if A-2*b > 0 else 0)

### FIXED CODE ###

A, B = map(int, input().split())
print(A - 2 * B if A - 2 * B > 0 else 0)
S = list(input())
K = int(input())

for s in S:
    if s != '1':
        ans = s
        break
    else:
        continue
print(ans)

### FIXED CODE ###

S = list(input())
K = int(input())

for i in range(K):
    if S[i] != '1':
        ans = S[i]
        break
    else:
        ans = 1
        continue
print(ans)
num_node = int(input())
relation = [[[], []] for i in range(num_node + 1)]
for i in range(num_node - 1):
    u, v, w = map(int, input().split())
    if w % 2 == 0:
        relation[u][0].append(v)
        relation[v][0].append(u)
    else:
        relation[u][1].append(v)
        relation[v][1].append(u)
colors = [None] * (num_node + 1)


def dfs(n: int):
    if n == 1:
        colors[n] = 0
    print(colors)
    # 偶数
    for even_idx in relation[n][0]:
        if colors[even_idx] is not None:
            continue
        else:
            colors[even_idx] = colors[n]
            dfs(even_idx)
    # 奇数
    for odd_idx in relation[n][1]:
        if colors[odd_idx] is not None:
            continue
        else:
            colors[odd_idx] = not colors[n]
            dfs(odd_idx)


if __name__ == '__main__':
    dfs(1)
    for ans in list(map(int, colors[1:])):
        print(ans)


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

num_node = int(input())
relation = [[[], []] for i in range(num_node + 1)]
for i in range(num_node - 1):
    u, v, w = map(int, input().split())
    if w % 2 == 0:
        relation[u][0].append(v)
        relation[v][0].append(u)
    else:
        relation[u][1].append(v)
        relation[v][1].append(u)
colors = [None] * (num_node + 1)


def dfs(n: int, c: int):
    colors[n] = c
    # 偶数
    for even_idx in relation[n][0]:
        if colors[even_idx] is not None:
            continue
        else:
            dfs(even_idx, colors[n])
    # 奇数
    for odd_idx in relation[n][1]:
        if colors[odd_idx] is not None:
            continue
        else:
            dfs(odd_idx, 1 - colors[n])


if __name__ == '__main__':
    dfs(1, 0)
    for ans in list(map(int, colors[1:])):
        print(ans)
def resolve():
    a,b,c,k=map(int,input().split())
    if a+b >=k:
        print(a)
    else:
        d=k-a-b
        print(a-d)
reslove()

### FIXED CODE ###

def resolve():
    a,b,c,k=map(int,input().split())

    if a>k:
        print(k)
    elif a + b >= k:
        print(a)
    elif a+b<k:
        d=k-a-b
        print(a-d)
resolve()
n = input()
x= input()

count = 0
me = 0
for i in range(n):
  if x[i] == "R":
    count +=1
  else:
    me +=1
    

if count > me:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

n = int(input())
x= input()

count = 0
me = 0
for i in range(n):
  if x[i] == "R":
    count +=1
  else:
    me +=1
    

if count > me:
  print("Yes")
else:
  print("No")
from collections import deque
N, Q = map(int, input().split())
G = [[] * N]
for i in range(N-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

count = [0] * N
for j in range(Q):
    p, x = map(int, input().split())
    count[p-1] += x

visited = [False] * N
que = deque([0])

while que:
    now = que.pop()
    visited[now] = True
    for nxt in G[now]:
        if visited[nxt]:
            continue
        count[nxt] += count[now]
        que.appendleft(nxt)

print(*count)

### FIXED CODE ###

from collections import deque
N, Q = map(int, input().split())
G = [[] for _ in range(N)]
count = [0] * N
for i in range(N-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

for j in range(Q):
    p, x = map(int, input().split())
    count[p-1] += x

que = deque([0])
flag = [False] * N

while que:
    v = que.pop()
    flag[v] = True
    for e in G[v]:
        if flag[e]:
            continue
        count[e] += count[v]
        que.appendleft(e)

print(*count)
n = int(input())
a = int(input())
b = int(input())

def add(n,a,b):
    print((n * b + (a - b)) - (n * a + (b - a)) + 1)
    return (n * b + (a - b)) - (n * a + (b - a)) + 1

add(n,a,b)

### FIXED CODE ###

n,a,b = map(int, input().split())
mi = a*(n-1)+b
ma = b*(n-1)+a
if ma -mi+1 < 0:
    print(0)
    quit()
print(ma-mi+1)
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    exit()
for i in range((pow(P,1/N))//1,,0,-1):
    if P%pow(i,N)==0:
        print(i)
        break

### FIXED CODE ###

from collections import Counter
N,P =map(int,input().split(' '))
if N==1:
    print(P)
    exit()
prime = []
f = 2
while f**2 <=P:
    if P%f==0:
        prime.append(f)
        P//=f
    else:
        f += 1
if P != 1:
    prime.append(f)

ans = 1
for k,v in Counter(prime).items():
    if v//N:
        ans *= k**(v//N)
print(ans)
import queue as q

def main():
    N, M = list(map(int, input().split()))
    D = {}
    for m in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        D.setdefault(u, set()).add(v)

    S, T = list(map(int, input().split()))
    S -= 1
    T -= 1
    print(f(D, S, T, M))

def f(D, S, T, M):
    close = [set(), set(), set()]
    Q = [None] * (10 ** 9)
    index = 0
    end = 1
    Q[0] = (S, 0, 0)

    while end > index:
        p, c, l = Q[index]
        index += 1
        if l == 0 and p == T:
            return c
        close[l].add(p)

        ns = D.setdefault(p, set())
        l, c = (l + 1) % 3, c + (l + 1) // 3
        for n in ns:
            if n in close[l]:
                continue
            Q[end] = (n, c, l)
            end += 1
    return -1

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = list(map(int, input().split()))

def f(D, S, T):
    close = [[False] * N, [False] * N, [False] * N]
    Q = []
    index = 0
    Q.append((S, 0, 0))

    while len(Q) > index:
        p, c, l = Q[index]
        index += 1
        
        if close[l][p]:
            continue
        
        if l == 0 and p == T:
            return c // 3
        close[l][p] = True

        l, c = (l + 1) % 3, c + 1
        for n in D[p]:
            if close[l][n]:
                continue
            Q.append((n, c, l))
    return -1

if __name__ == "__main__":
    D = {n: set() for n in range(N)}
    for m in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        D[u].add(v)

    S, T = list(map(int, input().split()))
    S -= 1
    T -= 1

    print(f(D, S, T))
x=int(input())
y=int(input())
print (x*y)


### FIXED CODE ###

a,b= map(int, input().split())
print(a*b, 2*(a+b))
import sys
s = input()

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit(0)
if s[i+1] == s[i+2]:
    print(i+2, i+3)
    sys.exit(0)
print("-1 -1")
sys.exit(0)

### FIXED CODE ###

import sys
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if i < len(s)-2:
        if s[i] == s[i+2]:
            print(i+1, i+3)
            sys.exit(0)
print("-1 -1")
sys.exit(0)
N = int(input())
eList = ['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']
n = N
mod = N
numList = []
 
while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
for num in numList:
  ans += eList[num]
print(ans)

### FIXED CODE ###

N = int(input())
eList = ['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']
n = N
mod = N
numList = []
 
while n > 0:
  n, mod = divmod(n,26)
  if mod != 0:
    numList.insert(0, mod - 1)
  else:
    numList.insert(0, 25)
    n -= 1
ans =''
for num in numList:
  ans += eList[num]
print(ans)
input = input()
a,b = [int(x) for x in input]

if a > b:
  print(a+a-1)
elif a == b:
  print(a+a)
else:
  print(b+b-1)

### FIXED CODE ###

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

if a == b:
  print(a+b)
elif a > b:
  print(a+a-1)
else:
  print(b+b-1)
def gcd(l, r):
  while r > 0:
    l, r = r, l % r
  return l

def main():
  N, K, *A = map(int, open(0).read().split())
  g = A[1] - A[0]
  for i in range(N-1):
    g = gcd(g, A[i+1] - A[i])
  if K % g == A[0] % g and K <= max(A):
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')

if __name__ == '__main__':
  main()

### FIXED CODE ###

def gcd(l, r):
  while r > 0:
    l, r = r, l % r
  return l

def main():
  N, K, *A = map(int, open(0).read().split())
  g = A[0]
  for a in A:
    g = gcd(g, a)
  if K % g == 0 and K <= max(A):
    print('POSSIBLE')
  else:
    print('IMPOSSIBLE')

if __name__ == '__main__':
  main()
class Need(object):
    def __init__(self,arg1,arg2):
        self.island1=int(arg1)
        self.island2=int(arg2)
        self.bridge=[]
        for i in range(arg1,arg2):
            self.bridge.append(i)
    def GETbridge(self):
        return self.bridge
deadbridges=0
islands,needsnum=map(int,input().split())
bridge=[0 for _ in range(islands-1)]
box = []
for i in range(needsnum):
    arg1,arg2=map(int,input().split())
    box.append(Need(arg1,arg2))
#ここから投票をする。
while(len(box)!=1):
    bridge = [0 for _ in range(islands - 1)]
    for need in box:
        list=need.GETbridge()
        for ing in list:
            bridge[ing-1]=bridge[ing-1]+1
    #集計終わり
    maxi=0
    for i in range(len(bridge)):
        if(bridge[i]>bridge[maxi]):
            maxi=i
    #橋を削除
    deadbridges=deadbridges+1
    #要望を削除
    kill=False
    for i in range(len(box)):
        try:
            s=box[i].GETbridge()
        except:
            break
        for k in s:
            if(k==bridge[maxi]):
                kill=True
                break
        if(kill):
            box.pop(i)
            i=i-1
print(deadbridges)

### FIXED CODE ###

list=input().split()
for i in list:
    i=int(i)
list.sort()
sumcosts=0
costs=0
first=True
mae=0
for i in list:
    i = int(i)
    if(first):
        first=False
        mae=i
    else:
        sumcosts=sumcosts+abs((i-mae))
        mae=i
print(sumcosts)
from sys import stdin
import sys
sys.setrecursionlimit(20000)
N,M,K=list(map(int,input().split()))
friend_list=[[] for _ in range(N+1)]
block_list=[[] for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    for friend in friend_list[j]:
        if friend not in color :
            friend_tansaku(i,friend)





for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].append(b)
   friend_list[b].append(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].append(b)
    block_list[b].append(a)
for i in range(1,N+1):
    color =set()
    friend_tansaku(i,i)
    for k in block_list[i]:
        color.add(k)
    count=len(color)-(len(friend_list[i])+len(block_list[i]))-1
    if i==N:print(count)
    else:print(count,end=" ")

### FIXED CODE ###

from sys import stdin
import sys
import copy
sys.setrecursionlimit(200000)
N,M,K=list(map(int,input().split()))
counter=[[None,None] for i in range(N+1)]
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    cnt[0]+=1
    for friend in friend_list[j]:
        if friend not in color :
            friend_tansaku(i,friend)





for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    cnt=[0]
    color =set()
    if counter[i][0] is None:
        friend_tansaku(i,i)
        cnt=cnt[0]
        for aa in color:
            counter[aa]=[color,cnt]
    color,cnt =counter[i][0],counter[i][1]
    for k in block_list[i]:
        if k not in color:
            cnt+=1

    count=cnt-(len(friend_list[i])+len(block_list[i]))-1
    if i==N:print(count)
    else:print(count,end=" ")
a,b,c = map(int,input().split())
d = a*b
if d>c:
print('c')
else:
print('d')


### FIXED CODE ###

a,b,c = map(int,input().split())
d = a*b
if d>c:
	print(c)
else:
	print(d)