Harryxun/stf_run huggingface dataset:
from math import gcd

n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []

for i in range(n):
    dis_list.append(x_list[i+1] - x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = gcd(dis_list[i],ans)

print(ans)

### FIXED CODE ###

from fractions import gcd

n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []

for i in range(n):
    dis_list.append(x_list[i+1] - x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = gcd(dis_list[i],ans)

print(ans)
def calc(i,x):
        if i ==0:
            return int((x % 4 == 1) or (x % 4 == 2))
        else:
            return int((x % (2**(i+1)) >= 2**i) and (x % 2 == 0))
     
    def main():
        A,B = map(int, input().split())
        
        #2^10 > 10^3⇒ 2^10^4 > 10^3^4
        ans = 0
        for i in range(41):
            ans += 2**i*(calc(i,A-1)^calc(i,B))# ^ calc(i,B)))
        print(ans)
        
    main()

### FIXED CODE ###

def calc(i,x):
    if i ==0:
        return int((x % 4 == 1) or (x % 4 == 2))
    else:
        return int((x % (2**(i+1)) >= 2**i) and (x % 2 == 0))

def main():
    A,B = map(int, input().split())
    
    #2^10 > 10^3⇒ 2^10^4 > 10^3^4
    ans = 0
    for i in range(41):
        ans += 2**i*(calc(i,A-1)^calc(i,B))# ^ calc(i,B)))
    print(ans)
    
main()
[a,b] = input().split()
a = int(a)
b= int(b)
if(a == b):
    print('a=b')
elif(a > b):
    print("a>b")
else:
    print("a<b)

### FIXED CODE ###

[a,b] = input().split()
a = int(a)
b= int(b)
if(a == b):
    print('a == b')
elif(a > b):
    print("a > b")
else:
    print("a < b")
l = map(int, input().split())

print(l[0] + l[3]/2)

### FIXED CODE ###

x, y = map(int, input().split())
print(x + y//2)
k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z=s:
                count+=1
print(count)

### FIXED CODE ###

k,s= list(map(int, input().split()))
count=0
for x in range(k+1):
    for y in range(k+1):
            if 0<=s-x-y <=k:
                count+=1
print(count)
S=str(input())
K=int(input())
if len(S)<=K:
    print(S)
else:
    print(S[:K]+"...")

### FIXED CODE ###

K=int(input())
S=input()
if len(S)<=K:
    print(S)
else:
    print(S[:K]+"...")
N = int(input())
lis = list(map(int,input().split()))
x = 0
lis.sort()
for i in range(0,N+1):
        if lis[i] == lis[i+1]:
                x = 1
                break
if x == 0:
        print("YES")
else:
        print("NO")

### FIXED CODE ###

S,T = input().split()
A,B = map(int,input().split())
U = input()
if U == S:
        print(A-1,B)
else:
        print(A,B-1)
N = int(input())
K = int(input())
L = len(str(N))

suu = []
for i in range(L):
    suu.append(int(str(N)[i]))

DP_1 =[[0 for k in range(L+1)] for i in range(L+1)]
DP_2 =[[0 for k in range(L+1)] for i in range(L+1)]
DP_2[0][0] = 1
for i in range(L):
    for k in range(L+1):
        DP_1[i+1][k] = DP_1[i][k] + DP_1[i][k-1] * 9 
        if suu[i]:
            DP_1[i+1][k] += DP_2[i][k] + DP_2[i][k-1] * max(suu[i] - 1, 0)
            DP_2[i+1][k] = DP_2[i][k-1]
        else:
            DP_2[i+1][k] = DP_2[i][k]
print(DP_1[L][K]+ DP_2[L][K])

### FIXED CODE ###

N = int(input())
K = int(input())
L = len(str(N))

suu = []
for i in range(L):
    suu.append(int(str(N)[i]))

DP_1 =[[0 for k in range(L+2)] for i in range(L+1)]
DP_2 =[[0 for k in range(L+2)] for i in range(L+1)]
DP_2[0][0] = 1
for i in range(L):
    for k in range(L+1):
        DP_1[i+1][k] = DP_1[i][k] + DP_1[i][k-1] * 9 
        if suu[i]:
            DP_1[i+1][k] += DP_2[i][k] + DP_2[i][k-1] * max(suu[i] - 1, 0)
            DP_2[i+1][k] = DP_2[i][k-1]
        else:
            DP_2[i+1][k] = DP_2[i][k]
print(DP_1[L][K]+ DP_2[L][K])
N, M = map(int, input().split())
lack = []
for _ in range(M):
    lack.append(int(input()))

mod = 1000000007

def fib(n):
    memo=["EMPTY"]*(n+1)
    def inner(n):
        if n in lack:
            return 0
        elif n == 0:
            return 1
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = inner(n-1)+inner(n-2)
            return memo[n] % mod
    return inner(n)

print(fib(N)% mod)

### FIXED CODE ###

P, Q, R = map(int, input().split())
lst = [P, Q, R]
lst = sorted(lst)
print(lst[0]+lst[1])
n,a,b = map(int, input().split())
l = [int(input()) for _ in range(n)]
print(len(filter(lambda x:a<=x<b,l)))

### FIXED CODE ###

n,a,b = map(int, input().split())
l = [int(input()) for _ in range(n)]
print(n-sum(map(lambda x:a<=x<b,l)))
a,b = list(map(int, split(input())))
 
if a == b:
    print("a" + " == " + "b")
elif a < b:
    print("a" + " < " + "b")
elif a > b:
    print("a" + " > " + "b")
else:
    print("timpo")

### FIXED CODE ###

a,b = map(int, input().split())
  
if a == b:
    print("a" + " == " + "b")
elif a < b:
    print("a" + " < " + "b")
else:
    print("a" + " > " + "b")
n=int(input())
list1=map(int,input().split())

q=int(input())
list2=map(int,input().split())

for i in range(len(list2)):
	list3=[]
	ok=0
	for j in range(len(list1)):
		if list2[i]<list1[j]:
			list3.append(list1[j])
	for k in range(len(list3)-1):
		if ok==1:
			break
		for l in range(1,len(list3)):
			if list3[k]+list3[l]==list2[i]:
				print("yes")
				ok=1
				break
	if ok==0:
		print("no")


### FIXED CODE ###


import itertools

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

q=int(input())
list2=list(map(int,input().split()))

sum1=set()

for i in range(1,n+1):
	x=list(itertools.combinations(list1,i))
	for j in x:
		sum1.add(sum(j))
		
		
for i in list2:
	if i in sum1:
		print("yes")
	else:
		print("no")
import collections
n = int(input())
v = list(map(int,input().split()))
ev = [v[i] for i in range(n) if i % 2 == 0]
ov = [v[i] for i in range(n) if i % 2 == 1]
#print(ov,ev)
E = collections.Counter(ev).most_common()
#print(E)
if len(E) == 1:
    e = E[0][0]
    e1 = E[0][0]
    e2 = E[0][0]
else:
    e1 = E[0][0]
    e2 = E[1][0]
O = collections.Counter(ov).most_common()
#print(O)
if len(O) == 1:
    o = O[0][0]
    if e == o:
        print(n//2)
        exit()
    else:
        print(0)
        exit()
else:
    o1 = O[0][0]
    o2 = O[1][0]

tmp = 0
for i in range(n):
    if i % 2 == 0 and v[i] != e1:
        tmp += 1
    elif i % 2 == 1 and v[i] != o2:
        tmp += 1
ttmp = 0
for i in range(n):
    if i % 2 == 0 and v[i] != e2:
        ttmp += 1
    elif i % 2 == 1 and v[i] != o1:
        ttmp += 1
        
print(min(tmp,ttmp))

### FIXED CODE ###

from collections import Counter
n = int(input())
v = list(map(int,input().split()))
o = Counter(v[::2]).most_common()
o.append((0,0))
e = Counter(v[1::2]).most_common()
e.append((0,0))
if o[0][0] == e[0][0]:
    ans = min(n - o[0][1] - e[1][1], n - o[1][1] - e[0][1])
else:
    ans = n - o[0][1] - e[0][1]
print(ans)
def main():
    number_of_bars = int(input())
    bar_list = list(map(int,input().split()))
    print(len(traiangle_maker(bar_list))//3)


def traiangle_maker(bar_list):
    bar_list.sort(reverse=True)
    result_list = []
    for i in range(len(bar_list)):
        for j in range(len(bar_list)):
            if i == j or bar_list[i] < bar_list[j]:
                continue
            minimum_length = bar_list[i] - bar_list[j]
            max_length = bar_list[i] + bar_list[j]
            for k in bar_list:
                if k > minimum_length and k < max_length and k != bar_list[i] and k != bar_list[j]:
                    traiangle = [bar_list[i],bar_list[j],k]
                    result_list.append(traiangle)

    return result_list


main()


### FIXED CODE ###

def main():
    width_of_window,width_of_cartain = map(int,input().split())
    print(cover_window(width_of_window,width_of_cartain))

def cover_window(width_of_window,width_of_cartain):
    if width_of_window <= width_of_cartain*2:
        return 0
    else:
        return width_of_window - width_of_cartain*2

main()
re,x=int(input().split())
print(' '.join(list(range(x-re+1,x+re))))

### FIXED CODE ###

re,x=map(int,input().split())
print(*list(range(x-re+1,x+re)))
import numpy as np

MOD = 10**9+7

D,T,E = input().split()
n= int(D)


### FIXED CODE ###

D,T,S = [int(i) for i in input().split()]
out = 'Yes' if D <= T * S else 'No'
print(out)
n, k = map(int, input().split())

ks = [x for x in range(1, n+1) if x % k == 0]
k2s = [x for x in range(1, n+1) if x % (k//2) == 0 and x % k != 0] 

if k % 2 == 0: # if even
    print(len(ks) ** 3 + len(k2s) ** 3)
else:
    print(len(ks) ** 3)

### FIXED CODE ###

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

ks = [x for x in range(1, n+1) if x % k == 0]

if k % 2 == 0: # if even
    k2s = [x for x in range(1, n+1) if x % (k//2) == 0 and x % k != 0] 
    print(len(ks) ** 3 + len(k2s) ** 3)
else:
    print(len(ks) ** 3)
N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,s+c):
        if T[i]<t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)


### FIXED CODE ###

N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,min(s+C,N)):
        if T[i]<=t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)
l = list(map(int, input().split()))

if l[0]<2 or l[0]>20 or l[1]<1 or l[1]>20:
	sys.exit()


a = 1
while l[0] < l[1]:
	l[1] = l[1] - l[0]
	a += 1
print(a)

### FIXED CODE ###

S=input()
T=input()
if len(S)>3 or len(S) < 1 or len(T)>3 or len(T) < 1:
  sys.exit()

a = 0
if S[0] == T[0]:
  a += 1
if S[1] == T[1]:
  a += 1
if S[2] == T[2]:
  a += 1

print(a)
def triangle(a, b, c):
    return (a < b + c) and (b < a + c) and (c < a + b)


def main():
    N = int(input())
    ll = input().split(" ")
    ll.sort()
    ll.reverse()
    L = []
    M = []
    tmp = ''
    for l in ll:
        if tmp != l:
            L.append(int(l))
            tmp = l
        else:
            M.append(int(l))
    result = 0
    # 3辺相異なるとき
    for i in range(len(L)):
        for j in range(i + 1, len(L)):
            a = L[i]
            b = L[j]
            for k in range(j + 1, len(L)):
                c = L[k]
                if triangle(a, b, c):
                    result += 1

    # 二等辺(正三角形含む)
    tmp = False
    for i in range(len(M)):
        a = M[i]
        for j in range(i + 1, len(M)):
            b = j[i]
            if a == b and tmp:
                tmp = True
                result += 1
            elif a == b and not tmp:
                continue
            elif triangle(a, a, b):
                tmp = False
                result += 1
            else:
                continue

    print(result)


if __name__ == '__main__':
    main()

### FIXED CODE ###

from bisect import bisect_left


def main():
    N = int(input())
    L = list(map(int, input().split(" ")))
    L.sort()
    result = 0
    for i in range(N):
        for j in range(i + 1, N):
            k = bisect_left(L, L[i] + L[j])
            result += k - j - 1
    print(result)


if __name__ == '__main__':
    main()
n=int(input())
a=list(map(int,input().split()))
a.sort()
print(a[len(a)-1]-a[0])

### FIXED CODE ###

a,b,c=map(int,input().split())
if((a*100+b*10+c)%4==0):
	print("YES")
else:print("NO")
a, b = input.split()
print(a)
print(b)

### FIXED CODE ###

def temp(val):
    [a,b]=val.split()
    a = int(a)
    b = int(b)
    print("{} {}".format(a*b, 2*a+2*b))

temp(input())
from dateutil.relativedelta import relativedelta
import datetime
#import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#print(0)
N =2
month, date = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する


for i in range(N):
  month[i], date[i] = map(int, input().split())

if date[1]==1:
    print(1)
else:
    print(0)
#print(datetime.date(2019, month[0], date[0]))
#today =datetime.date(2019, month[0], date[0])
#print(today+relativedelta(days=+1))
#nextday=today+relativedelta(days=+1)


### FIXED CODE ###

# -*- Coding: utf-8 -*-
#from dateutil.relativedelta import relativedelta
#import datetime
#import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#print(0)
N =2
month, date = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する


for i in range(N):
  month[i], date[i] = map(int, input().split())

if date[1]==1:
    print(1)
else:
    print(0)
n, q = map(int, input().split())
s = input()
for i in range(q):
    list_q = list(map(int, input().split()))
    list_q[1] = n - list_q[1]
    for i in range(list_q[0] - 1):
        s = s[1:]
    for i in range(list_q[1]):
        s = s[:-1]
    s = s.split("AC")
    print(len(s) - 1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, Q = map(int,input().split())
S = list(input())[:-1]
list_Sum = [0]*(N+1)
for i in range(1, N):
    list_Sum[i+1] = list_Sum[i]
    if S[i-1] == "A" and S[i] == "C":
        list_Sum[i+1] += 1
for i in range(Q):
    l, r = map(int,input().split())
    print(list_Sum[r]-list_Sum[l])
import math

def main():
    row_input = input()
    A = int(row_input.split()[0])
    B = int(row_input.split()[1])
    #A, B = list(map(int, input().split()))
    print(lcm(A, B))

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

if __name__ == "__main__":
    main()

### FIXED CODE ###

import fractions

def main():
    A, B = list(map(int, input().split()))
    print(lcm(A, B))

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

if __name__ == "__main__":
    main()
import re

s = input()
t = input()

match_result = re.match(s+".,t)

if match_result:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import re

s = input()
t = input()

match_result = re.match(s+".",t)

if match_result:
    print("Yes")
else:
    print("No")
from functools import lru_cache

MOD = 998244353


def solve_baka(n, m, k):
    print('params:', n, m, k)
    ans = 0
    for i in range(m**n):
        s = ''
        for j in range(n):
            s = str(i % m) + s
            i = i // m
        cnt = 0
        for j in range(n-1):
            if s[j] == s[j+1]:
                cnt += 1
        if cnt <= k:
            ans += 1
        print(s, cnt <= k)
    print('ans:', ans)
    return ans


@lru_cache(maxsize=None)
def modpow(n, m):
    if m == 0:
        return 1
    if m == 1 or n == 1 or n == 0:
        return n
    v = modpow(n, m // 2)
    v = v * v % MOD
    if m % 2 == 1:
        v = v * n % MOD
    return v


def solve(n, m, k):
    factorial = [1]
    for i in range(1, max(n+1, m+1)):
        factorial.append(i*factorial[i-1] % MOD)
    permutation = [1]
    for i in list(range(1, n))[::-1]:
        permutation.append(i * permutation[-1] % MOD)

    ans = 0
    for i in range(0, k+1):
        val = m * permutation[i] % MOD
        val = val * modpow(factorial[i], MOD-2) % MOD
        val = val * modpow(m-1, n-1-i) % MOD
        ans = (ans + val) % MOD
    return ans


def main():
    n, m, k = map(int, input())
    print(solve(n, m, k))

    # for n in range(3, 7):
    #     for m in range(1, 5):
    #         for k in range(0, n):
    #             assert solve_baka(n, m, k) == solve(n, m, k)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from functools import lru_cache

MOD = 998244353


def solve_baka(n, m, k):
    print('params:', n, m, k)
    ans = 0
    for i in range(m**n):
        s = ''
        for j in range(n):
            s = str(i % m) + s
            i = i // m
        cnt = 0
        for j in range(n-1):
            if s[j] == s[j+1]:
                cnt += 1
        if cnt <= k:
            ans += 1
        print(s, cnt <= k)
    print('ans:', ans)
    return ans


@lru_cache(maxsize=None)
def modpow(n, m):
    ret = 1
    while m > 0:
        if m & 1:
            ret = ret * n % MOD
        n = n * n % MOD
        m >>= 1
    return ret


def solve(n, m, k):
    factorial = [1]
    for i in range(1, max(n+1, m+1)):
        factorial.append(i*factorial[i-1] % MOD)
    permutation = [1]
    for i in list(range(1, n))[::-1]:
        permutation.append(i * permutation[-1] % MOD)

    ans = 0
    for i in range(0, k+1):
        val = m * permutation[i] % MOD
        val = val * modpow(factorial[i], MOD-2) % MOD
        val = val * modpow(m-1, n-1-i) % MOD
        ans = (ans + val) % MOD
    return ans


def main():
    # for n in range(3, 7):
    #     for m in range(1, 5):
    #         for k in range(0, n):
    #             assert solve_baka(n, m, k) == solve(n, m, k)
    n, m, k = map(int, input().split())
    print(solve(n, m, k))


if __name__ == '__main__':
    main()
N = int(input())
num = list(map(int,input().split()))
a = 1
for n in range(N):
  a = num[n]*a
if a> 10**18:
  a=-1
print(a)

### FIXED CODE ###

A, B = map(int, input().split())
print(A*B)
#!/usr/bin/python

import math
import sys

r = int(raw_input())

area = r * r * math.pi
length = 2 * r * math.pi

print str(area) + " " + str(length) + "\n"

sys.exit()

### FIXED CODE ###

import math
n = input()
S = '%.6f' % (float(n)**2 * math.pi)
L = '%.6f' % (float(n) * 2 * math.pi)
print "{} {}".format(S,L)
k,x,y = map(int,input().split())

if (x//k+1)*k <<y :
    print('YES')
else:
    print('NO')

### FIXED CODE ###

k= int(input())
x,y = map(int,input().split())
if 1<=x<=y<=1000 and 1<=k<=1000:
    pass



    if x%k>>0 :
        if x<= (x//k+1)*k <=y :
            print('OK')
        else:
            print('NG')
    else:
        print('OK')

else:
    print('NG')
s1, s2, s3 = input().split()
s = s1[0]+s2[0]+s3[0]
print(upper(s))

### FIXED CODE ###

s1, s2, s3 = input().split()
s = s1[0]+s2[0]+s3[0]
print(s.upper())
n, q = map(int, input().split())
tree = [[] for _ in range(2*n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    tree[a].append(b)
adds = [0]*(2*n)
for _ in range(q):
    p, x = map(int, input().split())
    adds[p] += x

res = [0]*(n+1)
def add_x(p, x):
    res[p] += x
    for child in tree[p]:
        new_x = x+adds[child]
        add_x(child, new_x)

add_x(1, adds[1])

print(' '.join(list(map(str, res[1:]))))

### FIXED CODE ###

import sys
from heapq import *
sys.setrecursionlimit(10**8)

input = sys.stdin.readline

tree = [[] for _ in range(200001)]
res = [0]*200001

def dfs(p, pre):
    for child in tree[p]:
        if child == pre: continue
        res[child] += res[p]
        dfs(child, p)

def main():
    """ main """
    N, Q = map(int, input().split())
    for _ in range(N-1):
        a,b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    for _ in range(Q):
        p,x = map(int, input().split())
        res[p] += x
    dfs(1, 0)

    print(*res[1:N+1])

if __name__ == '__main__':
    main()
n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
if n==1:
  print("Yes")
  exit()
for i in range(n-1):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")
    
      
  


### FIXED CODE ###

n=int(input())
A=[]
for i in range(n):
  a,b,c=map(int,input().split())
  if a<b+c or (b+c)%2!=a%2:
    print("No")
    exit()
  A.append([a,b,c])
if n==1:
  print("Yes")
  exit()
for i in range(n-1):
  if not A[i+1][0]-A[i][0]>=A[i+1][2]+A[i+1][1]-A[i][1]-A[i][2]:
    print("No")
    exit()
print("Yes")
n=int(input())
if n=25:
    print(Christmas)
if n=24:
    print(Christmas Eve)
if n=23:
    print(Christmas Eve Eve)
if n=22:
    print(Christmas Eve Eve Eve)

### FIXED CODE ###

n=int(input())
if n==25:
    print('Christmas')
if n==24:
    print('Christmas Eve')
if n==23:
    print('Christmas Eve Eve')
if n==22:
    print('Christmas Eve Eve Eve')
s = input()
K = int(input())

str_list = list(s)
str_list2 = list(s)
str_list2 = list(set(str_list2))
str_list2.sort()
a = str_list2[0]
n = str_list.count(a)

if K==1:
    print(a)
else:
    K -= 1
    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-1]
    if len(indexes) >0:
        sub_list = [s[i:i+2] for i in indexes]
    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-2]
    if len(indexes) >0:
        sub_list += [s[i:i+3] for i in indexes]
    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-3]
    if len(indexes) >0:
        sub_list += [s[i:i+4] for i in indexes]
    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-4]
    if len(indexes) >0:
        sub_list += [s[i:i+5] for i in indexes]
    sub_list = list(set(sub_list))
    sub_list.sort()
    if len(sub_list) >= K:
        print(sub_list[K-1])
    else:
        K -= len(sub_list)
        a = str_list[1]
        if K==1:
            print(a)
        else:
            K -= 1
            sub_list = []
            indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-1]
            if len(indexes) >0:
                sub_list = [s[i:i+2] for i in indexes]
            indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-2]
            if len(indexes) >0:
                sub_list += [s[i:i+3] for i in indexes]
            indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-3]
            if len(indexes) >0:
                sub_list += [s[i:i+4] for i in indexes]
            sub_list = list(set(sub_list))
            sub_list.sort()
            if len(sub_list) >= K:
                print(sub_list[K-1])
            else:
                K -= len(sub_list)
                a = str_list[2]
                if K==1:
                    print(a)
                else:
                    K -=1
                    sub_list = []
                    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-1]
                    if len(indexes) >0:
                        sub_list = [s[i:i+2] for i in indexes]
                    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-2]
                    if len(indexes) >0:
                        sub_list += [s[i:i+3] for i in indexes]
                    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-3]
                    if len(indexes) >0:
                        sub_list += [s[i:i+4] for i in indexes]
                    indexes = [i for i, x in enumerate(str_list) if x == a and i <len(s)-4]
                    sub_list = list(set(sub_list))
                    sub_list.sort()
                    print(sub_list[K-1])

### FIXED CODE ###

s = input()
K = int(input())

subset_list = list(s)
subset_list += [s[i:i+2] for i in range(len(s)-1)]
subset_list += [s[i:i+3] for i in range(len(s)-2)]
subset_list += [s[i:i+4] for i in range(len(s)-3)]
subset_list += [s[i:i+5] for i in range(len(s)-4)]
subset_list = list(set(subset_list))
subset_list.sort()

print(subset_list[K-1])
import numpy as np
a,b,s=map(float,input().split())
s=np.radians(s)
S=(a*b*np.sin(s))/2
h=b*np.sin(s)
l=a+b+(a**2+b**2-2*a*b*np.cos(s))
print(S)
print(l)
print(h)

### FIXED CODE ###

import math
a,b,c=map(float,input().split())
c=math.radians(c)
h=b*math.sin(c)
s=a*h/2
d=math.sqrt(a**2+b**2-2*a*b*math.cos(c))
l=a+b+d
print(s,l,h)
import math
 
a,b,h,m = map(int, input().split())
h1 = h * 30
m1 = m * 5.5
r = abs(h1 - m1)
a1 = a ** 2
b1 = b ** 2
ab = a * b
if r == 0:
  print(abs(a-b))
elif r == 180:
  print(a + b)
elif 180 < r:
  	r1 = r -180
    cos = math.cos(math.radians(r1))
 	d = a1 + b1 - 2 * ab * cos
  	ans = d ** (1/2)
  	print(ans)
else:
  cos = math.cos(math.radians(r))
  d = a1 + b1 - 2 * ab * cos
  ans = d ** (1/2)
  print(ans)

### FIXED CODE ###

import math
 
a,b,h,m = map(int, input().split())
h1 = h * 30
m1 = m * 5.5
r = abs(h1 - m1)
a1 = a ** 2
b1 = b ** 2
ab = a * b
if r == 0:
  print(abs(a-b))
elif r == 180:
  print(a + b)
elif 180 < r:
  r1 = 360 - r
  cos = math.cos(math.radians(r1))
  d = a1 + b1 - 2 * ab * cos
  ans = d ** (1/2)
  print(ans)
else:
  cos = math.cos(math.radians(r))
  d = a1 + b1 - 2 * ab * cos
  ans = d ** (1/2)
  print(ans)
A, B = int(input().split())
print(A*B)

### FIXED CODE ###

A, B = map(int, input().split())
print(A*B)