Harryxun/stf_run huggingface dataset:
# coding: utf-8
a, b, c, d = [int(i) for i in input().split()]
c1, d1 = [d if c < d else c, c if c < d else d]
while d1 > 1:
    e = d1
    d1 = c1 % d1
    c1 = e
e = c * d / e
cnt = (b - a + 1) + int(b / e) - int(a / e) - int(b / c) + int(a / c) - int(b / d) + int(a / d)
print(cnt)


### FIXED CODE ###

# coding: utf-8
a, b, c, d = [int(i) for i in input().split()]
c1 = d if c < d else c
d1 = c if c < d else d
while d1 != 0:
    e = d1
    d1 = c1 % d1
    c1 = e
e = int((c * d) / e)
a -= 1
cnt = (b - a) + int(b // e) - int(a // e) - int(b // c) + int(a // c) - int(b // d) + int(a // d)
print(cnt)
n = int(input())
A = list(map(int, input().split()))

S = sum(A)
d = 10**14
for i, a in enumerate(A):
  if abs(a*N-S) < d:
    d = abs(a*N-S)
    ind = i
    
print(ind)

### FIXED CODE ###

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

S = sum(A)
d = 10**14
for i, a in enumerate(A):
  if abs(a*n-S) < d:
    d = abs(a*n-S)
    ind = i
    
print(ind)
#二分探索...ソートした配列を二つに分けて、どちらに入るか調べることで高速化
import bisect

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

#リストを整列する
a.sort()
b.sort()
c.sort()

#二分探索で、それぞれのbについて、a<bになるaの個数を調べる
#二分探索で、それぞれのbについて、c>bになるcの個数を調べる
ans = 0
for i in range(n):
	ab = bisect.bisect_left(a,b[i])	#a==bの場合を除外する
	tmpbc = bisect.bisect_right(c,b[i])#b==cの場合を一度含んでおく
	bc = n-tmpbc
	
	ans += ab*bc
	
print(ans)


### FIXED CODE ###

c1 = input()
c2 = input()
print('YES' if c1 == c2[::-1] else 'NO')
n=int(input())
p=list(map(int,input().split()))
uuum = 0
for i in range(n-2):
  aaa = [p[i],p[i+1],p[i+2]]
  aaa.sort()
  if aaa[1]==p[i+1]:
    uuum+=1
print(uuum)


### FIXED CODE ###

s = ''.join(sorted(input()))
if(s[0]==s[1] and s[2] == s[3] and s[1] != s[3]):
  print("Yes")
else:
  print("No")
import math

R=int(input())
print(2*math.pie*R)


### FIXED CODE ###

import math
R=int(input())
print(2*R*math.pi)
N = int(input())
s = list(map(input().split()))
print(len(set(s)))


### FIXED CODE ###

N = int(input())
s = list(map(str, input().split()))
print(["Four", "Three"][len(set(s))==3])
import sys
N = int(input())

if N == 3:
    print('2 5 63')
    sys.exit()
if N == 4:
    print('2 5 20 63')
    sys.exit()

if N == 5:
    print('2 3 6 4 9')
    sys.exit()

if N = 20000:
    for i in range(5000):
        Tmp1 = 6 * i + 2
        Tmp2 = 6 * i + 3
        Tmp3 = 6 * i + 4
        Tmp4 = 6 * (i + 1)
        print('%d %d %d %d' %(Tmp1,Tmp2,Tmp3,Tmp4), end='')
        if Tmp4 == 30000:
            break
        else:
            print(' ', end='')
    
    print()
    sys.exit()


S = '2 3 6 4 9'

N -= 5

print(S, end='')

if N == 1:
    print(' 12')
    sys.exit()

for i in range(5001):
    
    Tmp1 = 6 * i + 8
    Tmp2 = 6 * i + 10
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2) , end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()
        
for i in range(5001):
    
    Tmp1 = 12 * i + 15
    Tmp2 = 12 * i + 21
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2), end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()   

for i in range(N):
    
    Tmp1 = 6 * (i + 3)
    if Tmp1 > 30000:
        break
    
    print(' %d' %(Tmp1) , end='')


print()



### FIXED CODE ###

import sys
N = int(input())

if N == 3:
    print('2 5 63')
    sys.exit()
if N == 4:
    print('2 5 20 63')
    sys.exit()

if N == 5:
    print('2 3 6 4 9')
    sys.exit()

if N == 20000:
    for i in range(5000):
        Tmp1 = 6 * i + 2
        Tmp2 = 6 * i + 3
        Tmp3 = 6 * i + 4
        Tmp4 = 6 * (i + 1)
        print('%d %d %d %d' %(Tmp1,Tmp2,Tmp3,Tmp4), end='')
        if Tmp4 == 30000:
            break
        else:
            print(' ', end='')
    
    print()
    sys.exit()


S = '2 3 6 4 9'

N -= 5

print(S, end='')

if N == 1:
    print(' 12')
    sys.exit()

for i in range(5001):
    
    Tmp1 = 6 * i + 8
    Tmp2 = 6 * i + 10
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2) , end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()
        
for i in range(5001):
    
    Tmp1 = 12 * i + 15
    Tmp2 = 12 * i + 21
    if Tmp2 > 30000:
        break
    
    print(' %d %d' %(Tmp1, Tmp2), end='')
    N -= 2
    if N == 0:
        print()
        sys.exit()
    elif N == 1:
        print(' 12')
        sys.exit()   

for i in range(N):
    
    Tmp1 = 6 * (i + 3)
    if Tmp1 > 30000:
        break
    
    print(' %d' %(Tmp1) , end='')


print()
n = int(input())
xyh = []
xyh0 = []
for i in range(0,n):
    X,Y,h = map(int,input().split())
    if h != 0:
        xyh.append((X,Y,h))
    else:
        xyh0.append((X,Y))
ans = []
for i in range(0,101):
    for j in range(0,101):
        flag = "f"
        if len(xyh)>0:
            x,y,h = xyh[0]
            H = h + abs(x-i)+abs(y-j)
            flag = "t"
        for x,y,h in xyh:
            if H !=  h + abs(x-i)+abs(y-j):
                flag = "f"
                break
        if flag == "t":
            ans.append((i,j,H))
if len(ans) > 0:
    for i,j,H in ans:
        flag == "f":
        for x,y in xyh0:
            flag = "t"
            if H < h + abs(x-i)+abs(y-j):
                flag = "f"
                break
        if flag == "t":
            ans = [(i,j,H)]
        if len(ans) == 1:
            break
print(x,y,h)













#


### FIXED CODE ###

n = int(input())
xyh = []
for i in range(0,n):
    X,Y,h = map(int,input().split())
    xyh.append((X,Y,h))
from operator import itemgetter
xyh.sort(key=itemgetter(2))
xyh.reverse()

ans = ()
for i in range(0,101):
    for j in range(0,101):
        flag = "f"
        x,y,h = xyh[0]
        H = h + abs(x-i)+abs(y-j)
        for x,y,h in xyh:
            if H ==  h + abs(x-i)+abs(y-j) and h != 0:
                flag = "t"
            elif H <=  h + abs(x-i)+abs(y-j) and h == 0:
                flag = "t"
            else:
                flag = "f"
                break
        if flag == "t":
            ans = (i,j,H)
Cx,Cy,H = ans
print(Cx,Cy,H)
a=int(input())
s=int(input())

if a>=3200:
  print(S)
else:
  print("red")

### FIXED CODE ###

a=int(input())
s=str(input())

if a>=3200:
  print(s)
else:
  print("red")
import math
r = int(input())
if r == 0:
    print('%f %f' % (0, 0))
else:
    print("%f %f" % (math.pi * r**2, math.pi * r * 2))

### FIXED CODE ###

import math
r = float(input())
print("%f %f" % (math.pi * r**2, math.pi * r * 2))
n=int(input())
a=int(input())
b=int(input())
c=a+b
print("Hello World" if n==1 else str(c))

### FIXED CODE ###

n=int(input())
if n==2:
  a=int(input())
  b=int(input())
  c=a+b
print("Hello World" if n%2==1 else str(c))
A = int(input())
B = int(input())

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')

### FIXED CODE ###

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

if A > 8 or B > 8:
    print(':(')
else:
    print('Yay!')
n,k,s=map(int,input().split()),list(map(int,input().split()));s.sort();print(sum(s[-k:]))

### FIXED CODE ###

n,k=map(int,input().split())
s=list(map(int,input().split()));s.sort();print(sum(s[-k:]))
keys = input()
outputs = []

for key in keys:
    if key == 'B':
        outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')


### FIXED CODE ###

keys = input()
outputs = []

for key in keys:
    if key == 'B':
        if not outputs:
            pass
        else:
            outputs.pop()
    else:
        outputs.append(key)

for output in outputs:
    print(output, end='')
import sys
import itertools
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数
from math import ceil, floor, sqrt, isinf #小数点切り上げ、切り捨て、平方根
from copy import deepcopy #参照で影響されないコピー
from collections import Counter, deque #要素ごとの出現回数、双方向アクセス可能データ型
import heapq
import numpy as np
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template


def main():
    n = int(input())
    abc = [list(map(int, input().split())) for _ in range(n)]

    dp = [ [0, 0, 0] for _ in range(n) ]

    dp[0] = abc[0]

    for i in range(1, n):
        for j in range(3):
            for k in range(3):
                if(j == k):
                     continue
                dp[i][k] = max(dp[i][k], dp[i][j] + abc[i][k])

    ans = 0
    for i in range(3):
        ans = max(ans, dp[n][i])

    print(ans)


if __name__ == "__main__":
    main()



### FIXED CODE ###

import sys
import itertools
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数
from math import ceil, floor, sqrt, isinf #小数点切り上げ、切り捨て、平方根
from copy import deepcopy #参照で影響されないコピー
from collections import Counter, deque #要素ごとの出現回数、双方向アクセス可能データ型
import heapq
import numpy as np
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template

def retmax(a, b):
    if a > b:
        return a
    else:
        return b

def main():
    n = int(input())
    a = [list(map(int, input().split())) for _ in range(n)]

    dp = np.zeros([3, n+1])

    for i, a_l in enumerate(a):
        for j in range(3):
            for k in range(3):
                if j != k:
                    dp[k, i+1] = retmax(dp[k, i+1], dp[j, i] + a_l[k])

    print(int(np.max(dp[:, n], axis=0)))


if __name__ == "__main__":
    main()
import heapq
N,W=map(int,raw_input().split())
wv=[]

w_sum=0
for i in range(N):
	w,v=map(int,raw_input().split())
	w_sum+=w
	wv.append((w,v))


a=[ float("-inf") for i in range(w_sum*2) ]

i=0
i=1
q=[]
for ind_i, i in enumerate(wv):
	w=i[0]
	v=i[1]
	#Initialize
	if ind_i==0:
		a[0]=0
		a[w]=v
		continue
	#Put queue
	for ind_j, j in enumerate(a):
		if j!=float("-inf"):
			heapq.heappush(q,(ind_j,j))
	
	while len(q)!=0:
		ind_j, j=heapq.heappop(q)
		a[ind_j+w]=max(a[ind_j+w], a[ind_j]+v)
		
print max(a[:W+1])




### FIXED CODE ###

A,B,C=raw_input().split()
print "YES" if A[-1]==B[0] and B[-1]==C[0] else "NO"
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP=P,s=2):
    for i in range(s,lim+1):
        if newP % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            newP //= i
            s = i
            break
    
        if newP == 1 or i == lim+1:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
    my(N,newP,s)

my(N)

### FIXED CODE ###

N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)
q=input()
x=[int(i) for i in input().split()]
cnt=input()
y=[int(i) for i in input().split()]

if max(x) >= max(y):
    MAX=max(x)
else:
    MAX=max(y)

z=[0]*(MAX+1)

print('YES')

### FIXED CODE ###


q=input()
x=[int(i) for i in input().split()]
cnt=input()
y=[int(i) for i in input().split()]

if max(x) >= max(y):
    MAX=max(x)
else:
    MAX=max(y)

dic = {}

for k in x :
    if k in dic.keys() :
        dic[k] += 1
    else :
        dic[k] = 1
    
for i in y :
    if i in dic.keys() :
        dic[i] -= 1
        if dic[i] == -1 :
            print('NO')
            exit()
    else :
        print('NO')
        exit()
print('YES')
import fractions

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

ans = a[0] * a[1] // fractions.gcd(a[0],a[1])

for i in range(1,n-1):
    ans = ans * a[i+1] // fractions.gcd(ans,a[i+1])
    
print(ans)

### FIXED CODE ###

import fractions

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

if len(a) == 1:
    print(a[0])
    exit()

ans = a[0] * a[1] // fractions.gcd(a[0],a[1])

for i in range(1,n-1):
    ans = ans * a[i+1] // fractions.gcd(ans,a[i+1])
    
print(ans)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a = INT()
b = INT()
h = INT()
print(int((a+b)*h/2))import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a = INT()
b = INT()
h = INT()
print(int((a+b)*h/2))

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a = INT()
b = INT()
h = INT()
print(int((a+b)*h/2))
N=int(input())
A=[int(i) for i in input().split()]

A.sort(reverse=True)

x=0
y=0
for i in range(len(A)):
      x=A[0]
      if A[0]==A[1]:
          A.remove(x)
          A.remove(x)
          if A[0]==A[1]:
                y=A[0]
                break
      else:
          A.remove(x)
print(x*y)


### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]

A.sort(reverse=True)

x=0
y=0
for i in range(N-1):
      if A[0]==A[1]:
          x=A[0]
          A.remove(x)
          A.remove(x)
          break
      else:
          A.remove(A[0])
if len(A)>=2:
    for i in range(len(A)-1):
        if A[0]==A[1]:
            y=A[0]
            break
        else:
            A.remove(A[0])

print(x*y)
n = int(input())

a = np.zeros(n,dtype=int)
b = np.zeros(n,dtype=int)

for i in range(n):
    a[i],b[i] = map(float, input().split())

#listをsortする
if n == 1:
    a0 = [a[0]]
    b0 = [b[0]]
elif n==2:
    a0 = [a[0]]
    b0 = [b[0]]
    if a[1]>=a[0]:
        a0.append(a[1])
    else:
        a0.insert(0,a[1])
    if b[1]>=a[0]:
        b0.append(b[1])
    else:
        b0.insert(0,b[1])
else:
    a0 = [a[0]]
    b0 = [b[0]]
    if a[1]>=a[0]:
        a0.append(a[1])
    else:
        a0.insert(0,a[1])
    if b[1]>=a[0]:
        b0.append(b[1])
    else:
        b0.insert(0,b[1])    
    for i in range(2,n):
        if a[i]>=a0[len(a0)-1]:
            a0.append(a[i])
        elif a[i]<=a0[0]:
            a0.insert(0,a[i])
        else:
            for j in range(len(a0)-1):
                if a0[j]<=a[i] and a[i]<=a0[j+1]:
                    a0.insert(j+1,a[i])
        if b[i]>=b0[len(b0)-1]:
            b0.append(b[i])
        elif b[i]<=b0[0]:
            b0.insert(0,b[i])
        else:
            for j in range(len(b0)-1):
                if b0[j]<=b[i] and b[i]<=b0[j+1]:
                    b0.insert(j+1,b[i])

                    
if n%2 == 1:
    a0cen = a0[int((n-1)/2)]
    b0cen = b0[int((n-1)/2)]
    nn = b0cen - a0cen + 1
else:
    a0cen1 = a0[int((n-2)/2)]+a0[int(n/2)]
    b0cen1 = b0[int((n-2)/2)]+b0[int(n/2)]
    nn = int(b0cen -a0cen +1)

print(nn)           


### FIXED CODE ###

import numpy as np

        
n = int(input())

a = np.zeros(n,dtype=int)
b = np.zeros(n,dtype=int)

for i in range(n):
    a[i],b[i] = map(float, input().split())

#listをsortする
a.sort()
b.sort()
                    
if n%2 == 1:
    a0cen = a[(n-1)//2]
    b0cen = b[(n-1)//2]
    nn = b0cen - a0cen + 1
else:
    a0cen1 = a[(n-2)//2]+a[n//2]
    b0cen1 = b[(n-2)//2]+b[n//2]
    nn = int(b0cen1 -a0cen1 +1)

print(nn)
O = input()
E = input()

l = min(len(O), len(E))
s = ""
for i in range(l):
  s = s + O[i] + E[i]

if len(O) > len(E):
  s = s + O[len(O)]

print(s)


### FIXED CODE ###

O = input()
E = input()

L = []
for i in range(len(O)):
  L.append(O[i])
  L.append("")

for j in range(len(E)):
  L[2*j+1] = E[j]

l = ""
for i in range(len(L)):
  l = l + L[i]

print(l)
letter=list(input())
n=int(input())
for i in range(n):
    ope=input().split(" ")
    o1=int(ope[0])
    if o1 ==1:
        letter.reverse()
    else:
        o2,o3_s=int(ope[1]),ope[2]
        if o2==1:
            for j in range( 1,len(o3_s)+1):
                letter.insert(0,o3_s[len(o3_s)-j])
        else:
            for j in range(len(o3_s)):
                letter.append(o3_s[j])
print("".join(letter))

### FIXED CODE ###

letter=input()
if "A" not in letter:
  print("No")
elif "B" not in letter:
  print("No")
else:
  print("Yes")
import copy
n, m = map(int, input().split())
p = [list(map(int, input().split())) for i in range(m)]
dic = {}
q = p.copy()
q.sort(key=lambda x: x[1])
cnt = [0 for i in range(n+1)]
for i in range(m):
    cnt[q[i][0]] += 1
    dic[q[i][1]] = cnt[q[i][0]]
for i in range(m):
    print(str(p[i][0]).zfill(6)+str(dic[p[i][1]]).zfill(6))

### FIXED CODE ###

import copy
n, m = map(int, input().split())
p = [list(map(int, input().split())) for i in range(m)]
dic = {}
q = copy.copy(p)
q.sort(key=lambda x: x[1])
cnt = [0 for i in range(n+1)]
for i in range(m):
    cnt[q[i][0]] += 1
    dic[q[i][1]] = cnt[q[i][0]]
for i in range(m):
    print(str(p[i][0]).zfill(6)+str(dic[p[i][1]]).zfill(6))
n = int(input())
d = list(map(int,input().split()))
d.sort()
if (len(d))%2 == 0:
  m = (d[(len(d)//2)-1]+d[len(d)//2])/2
else:
  m = d[(len(d)//2)]
p = 0
q = 0
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
print(p-q)

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
# -*- coding: utf-8 -*-
from collections import deque
n,k = map(int, input().split())
td = []

for _ in range(n):
    t,d = map(int, input().split())
    td.append((t,d))

td.sort(reverse=True, key=lambda x:x[1])

used = set()
q = []
res = 0
kind = 0
for i in range(k):
    t,d = td[i]
    if t not in used:
        kind += 1
        used.add(t)
    else:
        q.append((t,d))
    res += d
res += kind**2
q = deque(sorted(q, key=lambda x:x[1]))

tmp = res
for i in range(k,n):
    t2,d2 = td[i]
    if t2 in used:
        continue
    t,d = q.popleft()

    r = tmp - d + d2
    r -= kind**2
    kind += 1
    r += kind**2
    res = max(res, r)
    tmp = r
    if len(q)==0:
        break

print(res)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import deque
n,k = map(int, input().split())
td = []

for _ in range(n):
    t,d = map(int, input().split())
    td.append((t,d))

td.sort(reverse=True, key=lambda x:x[1])

used = set()
q = []
res = 0
kind = 0
for i in range(k):
    t,d = td[i]
    if t not in used:
        kind += 1
        used.add(t)
    else:
        q.append((t,d))
    res += d
res += kind**2
q = deque(sorted(q, key=lambda x:x[1]))

tmp = res
for i in range(k,n):
    if len(q)==0:
        break
    t2,d2 = td[i]
    if t2 in used:
        continue
    used.add(t2)
    t,d = q.popleft()

    r = tmp - d + d2
    r -= kind**2
    kind += 1
    r += kind**2
    res = max(res, r)
    tmp = r

print(res)
N,S,K=map(int,input().split())
ans=[S]*K +[S+1]*(N-K)
print(*ans)


### FIXED CODE ###

N, K, S = map(int, input().split())

ans = [0]*N
T = 10**9
if T == S:
    T = 10**9 - 1
for i in range(N):
    if i < K:
        ans[i] = S
    else:
        ans[i] = T
print(" ".join(map(str, ans)))
N = input().split()[0]
words = [input() for i in range(N)]
print("".join(words.sort()))

### FIXED CODE ###

N = int(input().split()[0])
words = [input().strip() for i in range(N)]
print("".join(sorted(words)))
n = int(input())

l = []
for i in range(n):
    x,y,h = map(int,input().split())
    if h > 0 :
        l.append([x,y,h])

for cx in range(100+1):
    for cy in range(100+1):
              
        count = 0
        preheight = abs(l[0][0]-cx) + abs(l[0][1]-cy) + l[0][2]

        for i in range(n):            
            height = abs(l[i][0]-cx) + abs(l[i][1]-cy) + l[i][2] 
            if preheight != height:
                break

            count = count + 1

        if count >= len(l) :
            print(cx,cy,preheight)
            exit(0)


### FIXED CODE ###

n = int(input())

l = []
a = {}
b = {}

for i in range(n):
    x,y,h = map(int,input().split())
    if h > 0 :
        l.append([x,y,h])

for cx in range(100+1):
    for cy in range(100+1):
              
        count = 0
        preheight = abs(l[0][0]-cx) + abs(l[0][1]-cy) + l[0][2]

        for ll in l :
            height = abs(ll[0]-cx) + abs(ll[1]-cy) + ll[2] 
            if preheight != height:
                break
            count = count + 1

        if count >= len(l) :
            if preheight in a:
                a[preheight] += 1
                b[preheight] = [cx,cy]
            else:
                a[preheight] = 1
                b[preheight] = [cx,cy]

for ans in a.keys() :
    if a[ans] == 1 :
        print(b[ans][0],b[ans][1],ans)
        exit(0)
N=int(input())
S=input()
count = 0
for i in range(1000):
    x= i%10
    z= i//100
    y= (i-x-(z*100))//10
    
    p=0
    for j in range(N):
        if S[j]!=str(z):
            p = p+1
        else:
          for k in range(p+1,N):
            if S[k]!=str(y):
                p = p+1
            else:
                for l in range(q+1,N):
                  if S[l]!=str(x):
                    p = p+1
                  else:
                    break
                
                
    if p<=N-2:
      count = count+1
    else:
      count = count

### FIXED CODE ###

X=int(input())
if X//100 != X//105:
  print(1)
elif X//100 == X//105 and X%105==0:
  print(1)
else:
  print(0)
n,m=map(int,input.split())
if n%2==0:
  counter=0
  for i in range(min(m,n//4)):
    print(i+1)
    print(n-i)
    counter+=1
  if counter<m:
    for i in range(n//4,m):
      print(i+1)
      print(n-i-1)
  else:
    for i in range(m):
      print(i+1)
      print(n-i)

### FIXED CODE ###

n,m=map(int,input().split())
if n%2==0:
  counter=0
  for i in range(min(m,n//4)):
    print(i+1)
    print(n-i)
    counter+=1
  if counter<m:
    for i in range(n//4,m):
      print(i+1)
      print(n-i-1)
else:
  for i in range(m):
    print(i+1)
    print(n-i)
n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(c,t):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

### FIXED CODE ###

n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(int,input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(clist,tlist):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)
x=int(input().split())
s=x[0]*x[1]
l=2*x[0]+2*x[1]
print("{0} {1}",format(x[0],x[1]))

### FIXED CODE ###

x,y=[int(i) for i in input().split()]
s=x*y
l=2*x+2*y
print(s,l)