Harryxun/stf_run huggingface dataset:
N = int(input())
a = list(map(int, input().split()))
if abs(max(a)) >= abs(min(a)):
    for i in range(N):
        if a[i] = max(a):
            num = i
            break
    print(2*N-1)
    for i in range(N):
        if num != i:
            print(num+1, i+1)
    print(num+1, num+1)
    for i in range(1,N):
        print(i, i+1)
else:
    for i in range(N):
        if a[i] = min(a):
            num = i
            break
    print(2*N-1)
    for i in range(N):
        if num != i:
            print(num+1, i+1)
    print(num+1, num+1)
    for i in range(N):
        print(N-i, N-i-1)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
cnt1 = 0
li1 = []
for i in range(1,N):
    M = max(a)
    num = 0
    for j in range(N):
        if a[j] == M:
            n = j
    if a[i] < a[i-1]:
        if M <= 0:
            cnt1= -1
            break
        num += -((-a[i-1]+a[i])//M)
        if num < 0 or num > 2*N:
            cnt1 = -1
            break
        a[i] += num*M
        for j in range(num):
            li1.append([n+1, i+1])
        cnt1 += num
cnt2 = 0
li2 = []
for i in range(1,N):
    M = min(a)
    num = 0
    for j in range(N):
        if a[j] == M:
            n = j
    if a[N-i] < a[N-i-1]:
        if M >= 0:
            cnt2 = -1
            break
        num += -((-a[N-i-1]+a[N-i])//(-M))
        if num < 0 or num > 2*N:
            cnt2 = -1
            break
        a[N-i-1] += num *M
        for j in range(num):
            li2.append([n+1, N-i])
        cnt2 += num
if cnt1 <= 2*N and cnt1 >= 0:
    print(cnt1)
    for x in li1:
        print(*x)
else:
    print(cnt2)
    for x in li2:
        print(*x)
def brain(l):
    c = l[1] - l[0]
    if 0 < c:
        result.append(c)
        del lis[0]
        del lis[0]
    else:
        lis.append(l[0])
        del lis[0]
        
def cisco(l):
    for i in range(len(l)):
        if l[i] == 'I':
            l[i] = 1
        elif l[i] == 'V':
            l[i] = 5
        elif l[i] == 'X':
            l[i] = 10
        elif l[i] == 'L':
            l[i] = 50
        elif l[i] == 'C':
            l[i] = 100
        elif l[i] == 'D':
            l[i] = 500
        elif l[i] == 'M':
            l[i] = 1000
    return l

while True:
    result = []
    try:
        lis = list(raw_input())+['*']
        while lis:
            if not (lis[0] == '*' or lis[1] == '*'):
                l = cisco([lis[0], lis[1]])
                brain(l)
            else:
                lis.append(lis[0])
                del lis[0]
                del lis[0]
                break
        result.append(sum(cisco(lis)))
        print sum(result)
    except EOFError:
        break

### FIXED CODE ###

def brain(l):
    c = l[1] - l[0]
    if 0 < c:
        result.append(c)
        del lis[0]
        del lis[0]
    else:
        lis.append(l[0])
        del lis[0]
        
def cisco(l):
    for i in range(len(l)):
        if l[i] == 'I':
            l[i] = 1
        elif l[i] == 'V':
            l[i] = 5
        elif l[i] == 'X':
            l[i] = 10
        elif l[i] == 'L':
            l[i] = 50
        elif l[i] == 'C':
            l[i] = 100
        elif l[i] == 'D':
            l[i] = 500
        elif l[i] == 'M':
            l[i] = 1000
    return l

while True:
    result = []
    try:
        lis = list(raw_input())+['*']
        while lis:
            if not (lis[0] == '*' or lis[1] == '*'):
                l = cisco([lis[0], lis[1]])
                brain(l)
            elif lis[0] == '*':
                del lis[0]
                break
            elif lis[1] == '*':
                l = cisco([lis[0]])
                lis.append(l[0])
                del lis[0]
                del lis[0]
                break
        result.append(sum(lis))
        print sum(result)
    except EOFError:
        break
N, Q = [int(item) for item in input().split()]

tree_list = [input().split() for _ in range(1, N)]

query_list = [input().split() for _ in range(Q)]
query_list_int = [[int(k) for k in i] for i in query_list]

val_list = [0 for _ in range(N)]

linked_node_list = [[] for _ in range(N)]

for a, b in tree_list:
    linked_node_list[int(a) - 1].append(int(b) - 1)
    linked_node_list[int(b) - 1].append(int(a) - 1)


for index, val in query_list_int:
    val_list[index-1] += val


def dfs(node_index, pairent_index):
    for child in linked_node_list[node_index]:
        
        if child != pairent_index:
            val_list[child] += val_list[node_index]
            dfs(child, node_index)

    return val_list


res = dfs(0, -1)

print(*res)


### FIXED CODE ###

N, Q = [int(item) for item in input().split()]

tree_list = [input().split() for j in range(1, N)]

query_list = [input().split() for k in range(Q)]
query_list_int = [[int(k) for k in i] for i in query_list]

val_list = [0 for _ in range(N)]

linked_node_list = [[] for _ in range(N)]

for a, b in tree_list:
    a, b = int(a)-1, int(b) -1
    linked_node_list[a].append(b)
    linked_node_list[b].append(a)


for index, val in query_list_int:
    val_list[index-1] += val

stack = [0]
parent = [0] * (N+1)

while True:
    v=stack.pop()
    for child in linked_node_list[v]:
        if child != parent[v]:
            parent[child] = v
            stack.append(child)
            val_list[child] += val_list[v]
    if not stack:
        break

print(*val_list)
#include <iostream>
using namespace std;

int main() {
	int a , b , c ;
    int count = 3;
	cin >> a >> b >> c;
	if(a == b) count -= 1;
    if(a == c) count -= 1;
    if(b == c) count -= 1;
    if(count == 0) count += 1;
    cout << count;
      
	return 0;
}

### FIXED CODE ###

a = input().split()
a = list(a)
for i in range(3):
  a[i] = int(a[i])
a.sort()

if(a[0] == a[1]):
  if(a[1] == a[2]):
    print(1)
  else:
    print(2)
elif(a[1] == a[2]):
  print(2)
else:
  print(3)
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) - 1 for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

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

d = getSomeInputListInt(n)

path = []
for p in itertools.permutations(range(1, n), n-1):
    tmp = (0,) + p
    path.append(tmp)


def pathsearch(a, b):
    flga = False
    for tmp_d in d:
        if a in tmp_d and b in tmp_d:
            flga = True
            break

    return flga


ans = 0
for p in path:
    flg = True
    for i in range(1, n, 1):
        tmp = pathsearch(p[i - 1], p[i])
        if not tmp:
            flg = False
            break

    if flg:
        ans += 1

print(ans)


### FIXED CODE ###

import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) - 1 for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

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

d = getSomeInputListInt(m)

path = []
for p in itertools.permutations(range(1, n), n-1):
    tmp = (0,) + p
    path.append(tmp)


def pathsearch(a, b):
    flga = False
    for tmp_d in d:
        if a in tmp_d and b in tmp_d:
            flga = True
            break

    return flga


ans = 0
for p in path:
    flg = True
    for i in range(1, n, 1):
        tmp = pathsearch(p[i - 1], p[i])
        if not tmp:
            flg = False
            break

    if flg:
        ans += 1

print(ans)
n,m=map(int,input().split())
data=[0]*n
for i in range(n):
  a=list(map(int,input().split()))
  for j in range(1,a[0]+1):
    data[a[j]-1]+=1
print(data.count(n))

### FIXED CODE ###

n,m=map(int,input().split())
data=[0]*m
for i in range(n):
  a=list(map(int,input().split()))
  for j in range(1,a[0]+1):
    data[a[j]-1]+=1
print(data.count(n))
X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
Z = 0
while True:
  if p[X - 1] < r[Z]:
    X -= 1
    Z += 1
  elif q[Y - 1] < r[Z]:
    Y -= 1
    Z += 1
  else:
    break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))

### FIXED CODE ###

X, Y, A, B, C = list(map(int,input().split()))
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
 
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
 
p.append(float("inf"))
q.append(float("inf")) 

Z = 0
while Z < C:
  if min(p[X - 1], q[Y - 1]) < r[Z]:
    if p[X - 1] < q[Y - 1]:
      X -= 1
      Z += 1
    else:
      Y -= 1
      Z += 1
    continue
  break
 
print(sum(p[:X]) + sum(q[:Y]) + sum(r[:Z]))
#input number
n = raw_input()

if n < 1 and n > 100:
	exit()

# input elements
l = raw_input()

elements = l.split()

for e in elements:
	o += str(e) + ' '
print o

for i in range(1, int(n)):
	key = elements[i]
	j = i - 1
	while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	elements[j + 1] = key
	# output
	o = ''
	for e in elements:
		o += str(e) + ' '
	print o

### FIXED CODE ###

#input number
n = raw_input()

if n < 1 and n > 100:
	exit()

# input elements
l = raw_input()

elements = [int(e) for e in l.split()]

print ' '.join(str(e) for e in elements)

for i in range(1, int(n)):
	key = elements[i]
	j = i - 1
	while j >= 0 and elements[j] > key:
		elements[j + 1] = elements[j]
		j -= 1
	elements[j + 1] = key
	# output
	print ' '.join(str(e) for e in elements)
import math

N=int(input())
S=[]
T=[]
m=a=r=c=h=0
for i in range(N):
    S.append(list(input()))
    if S[i][0]=="M" or S[i][0]=="A" or S[i][0]=="R" or S[i][0]=="C" or S[i][0]=="H":
        T.append(S[i][0])
K=set(T)
P=[]
for i in K:
    P.append(T.count(i))
if P==[]: ans=0
else: ans=math.factorial(sum(P))//(6*math.factorial(sum(P)-3))

for i in range(len(P)):
    if P[i]>2:
        ans-=(math.factorial(P[i])//6)*(len(P)-1)
    if P[i]>1:
        ans-=math.factorial(P[i])//2*(len(P)-1)

print(ans)


### FIXED CODE ###

N=int(input())
T=[0]*5
for i in range(N):
    S=input()
    if S[0]=="M": T[0]+=1
    elif S[0]=="A": T[1]+=1
    elif S[0]=="R": T[2]+=1
    elif S[0]=="C": T[3]+=1
    elif S[0]=="H": T[4]+=1

ans=0
for i in range(5):
    for j in range(i+1,5):
        for k in range(j+1,5):
            ans+=T[i]*T[j]*T[k]
print(ans)
N = int(input())
a = [int(input()) for i in range(N)]
num = a[0]
ans = 0
check = 0
for n in range(1, N):
    num = a[num-1]
    if num-1 == 1:
        ans = n + 1
        check = 1
        break
if check != 1:
    print('-1')
else:
    print(ans)


### FIXED CODE ###

x, a, b = [int(i) for i in input().split()]
if b <= a:
    print('delicious')
elif (b-a) <= x:
    print('safe')
else:
    print('dangerous')
n, a, b = map(int,input().split())
if n＊a <= b:
  print(n＊a)
else:
  print(b)

### FIXED CODE ###

n, a, b = map(int,input().split())
if n*a > b:
  print(b)
else:
  print(n*a)
from functools import partial
from itertools import islice


def take(n, iterable):
    return list(islice(iterable, n))


def chunked(iterable, n):
    return iter(partial(take, n, iter(iterable)), [])


def distance(x, y):
    return abs(x[0] - y[0]) + abs(x[1] - y[1])


def solve(s):
    h, w, d, *aqlr = map(int, s.split())
    n = h * w
    pos = [(i // w, i % w) for i, _a in enumerate(aqlr[:n])]
    cost = [0] * (n + 1)
    for i in range(d + 1, n + 1):
        cost[i] = cost[i - d] + distance(pos[i - d], pos[i])
    return "\n".join(["%d" % (cost[r] - cost[l]) for l, r in chunked(aqlr[n + 1:], 2)])


n, m, d = map(int, input().split())
l = '{} {} {}\n'.format(n, m, d) + '\n'.join([input() for _ in range(n)])
q, = map(int, input().split())
l += '\n{}\n'.format(q) + '\n'.join([input() for _ in range(q)])
print(solve(l))


### FIXED CODE ###

import numpy as np

h, w, d = map(int, input().strip().split(" "))
a = [[int(i) for i in input().strip().split(" ")] for _ in range(h)]
q = int(input().strip())
lr = [input().strip().split(" ") for _ in range(q)]
rs = [None for _ in range(h * w)]
cs = [None for _ in range(h * w)]
for _r, _a in enumerate(a):
    for _c, __a in enumerate(_a):
        rs[__a - 1] = _r
        cs[__a - 1] = _c
rs_d = [rs[i::d] for i in range(d)]
cs_d = [cs[i::d] for i in range(d)]
costs = [
    np.cumsum(
        np.abs(np.array(_rs[1:]) - np.array(_rs[:-1])) +
        np.abs(np.array(_cs[1:]) - np.array(_cs[:-1]))) for _rs, _cs in zip(rs_d, cs_d)
]
for l, r in lr:
    l = int(l) - 1
    r = int(r) - 1
    if l == r:
        print(0)
    elif l < d:
        print(costs[r % d][r // d - 1])
    else:
        print(costs[r % d][r // d - 1] - costs[l % d][l // d - 1])
import sys

for i in sys.stdin:
    i = i.split(" ")
    x, y = int(i[0]), int(i[1])
    if x == y == 0: break
    elif x <= y:
       print('{0} {1}'.format(x, y))
    else:
       pritn('{0} {1}'.format(y, x))

### FIXED CODE ###

import sys
 
for i in sys.stdin:
    i = i.split(" ")
    x, y = int(i[0]), int(i[1])
    if x == y == 0:
       break
    elif x <= y:
       print("{0} {1}".format(x, y))
    else:
       print("{0} {1}".format(y, x))
N = int(input())
X = int(input())
T = int(input())
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c*T)


### FIXED CODE ###

n, x, t = input().split()
N = int(n)
X = int(x)
T = int(t)
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
C = int(c)
print(C*T)
a=int(input(""))
b=int(input(""))

p=(a+b)*2
Area=a*b

print(p,Area)



### FIXED CODE ###

a,b=map(int,input().split())
p=(a+b)*2
Area=a*b
print(Area,p)
D,N = map(int,(input().split()))
l = [[] for _ in range(3)]
for i in range(1,1000000):
    c = 0
    j = i
    while j%100 == 0:
        c += 1
        j //= 100
    if c < 3:
        l[c].append(i)

print(l[D][N-1])

### FIXED CODE ###

D,N = map(int,(input().split()))
l = [[] for _ in range(3)]
for i in range(1,1010001):
    c = 0
    j = i
    while j%100 == 0:
        c += 1
        j //= 100
    if c < 3:
        l[c].append(i)

print(l[D][N-1])
n=int(input())
if n=="1":
  print("Hello World")
else:
  a,b=map(int,input().split())
  print(a+b)


### FIXED CODE ###

n=int(input())
if n==1:
  print("Hello World")
else:
  a=int(input())
  b=int(input())
  print(a+b)
S=input()
n=len(S)
t=[]
for i in range(13):
  t.append(0)
s=t.copy()
t[0]=1
jkmap=[]
for j in range(10):
  jkmap.append([])
  for k in range(13):
    jkmap[j].append((10*k+j)%13)
for i in range(n):
  if S[i]=='?':
    tcopy=s.copy()
    for j in range(10):
      for k in range(13):
        tcopy[jkmap[j][k]]=(tcopy[jkmap[j][k]]+t[k])%(10**9+7)
    t=tcopy.copy()
  else:
    j=int(S[i])
    tcopy=s.copy()
    for k in range(13):
      tcopy[jkmap[j][k]]=(tcopy[jkmap[j][k]]+t[k])%(10**9+7)
    t=tcopy.copy()
print(t[5])


### FIXED CODE ###

S=input()
n=len(S)
t=[]
for i in range(13):
  t.append(0)
t[0]=1
jkmap=[]
for j in range(10):
  jkmap.append([])
  for k in range(13):
    jkmap[j].append((10*k+j)%13)
for i in range(n):
  if S[i]=='?':
    tcopy=[0]*13
    for j in range(10):
      for k in range(13):
        tcopy[jkmap[j][k]]=(tcopy[jkmap[j][k]]+t[k])%(10**9+7)
    for j in range(13):
      t[j]=tcopy[j]
  else:
    j=int(S[i])
    tcopy=[0]*13
    for k in range(13):
      tcopy[jkmap[j][k]]=(tcopy[jkmap[j][k]]+t[k])%(10**9+7)
    for j in range(13):
      t[j]=tcopy[j]
print(t[5])
n, m = map(int, input().split())
wars = {}
for i in range(m):
  a, b = map(int, input().split())
  if a in frontiers.keys():
    frontiers[a] = min(frontiers[a], b)
  else:
    wars[a] = b

cuts = 0
frontier = 10**6

for i in range(1, n):
  if i in frontiers.keys():
    antis = min(frontier, wars[i])
  if i + 1 == frontier:
    cuts += 1
    frontier = 10**6
    
print(cuts)


### FIXED CODE ###

n, m = map(int, input().split())
wars = {}
for i in range(m):
  a, b = map(int, input().split())
  if a in wars.keys():
    wars[a] = min(wars[a], b)
  else:
    wars[a] = b

cuts = 0
antis = 10**6

for i in range(1, n):
  if i in wars.keys():
    antis = min(antis, wars[i])
  if i + 1 == antis:
    cuts += 1
    antis = 10**6
    
print(cuts)
sys.setrecursionlimit(10 ** 5 + 10)

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

ans = list()
l = list()

for n in range(N):
    l.append(input())

def dfs(i, a, b, c):
    if i == N:
        return True

    ss = l[i]
    if ss == 'AB':
        if a == 0 and b == 0:
            return False
        if b > 0 and dfs(i + 1, a + 1, b - 1, c):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b + 1, c):
            ans.append('B')
            return True
    if ss == 'AC':
        if a == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a + 1, b, c - 1):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b, c + 1):
            ans.append('C')
            return True
    if ss == 'BC':
        if b == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a, b + 1, c - 1):
            ans.append('B')
            return True
        if b > 0 and dfs(i + 1, a, b - 1, c + 1):
            ans.append('C')
            return True
    return False

dfs(0, A, B, C)

if len(ans) > 0:
    print('Yes')
    for x in reversed(ans):
        print(x)
else:
    print('No')

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)

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

ans = list()
l = list()

for n in range(N):
    l.append(input())

def dfs(i, a, b, c):
    if i == N:
        return True

    ss = l[i]
    if ss == 'AB':
        if a == 0 and b == 0:
            return False
        if b > 0 and dfs(i + 1, a + 1, b - 1, c):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b + 1, c):
            ans.append('B')
            return True
    if ss == 'AC':
        if a == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a + 1, b, c - 1):
            ans.append('A')
            return True
        if a > 0 and dfs(i + 1, a - 1, b, c + 1):
            ans.append('C')
            return True
    if ss == 'BC':
        if b == 0 and c == 0:
            return False
        if c > 0 and dfs(i + 1, a, b + 1, c - 1):
            ans.append('B')
            return True
        if b > 0 and dfs(i + 1, a, b - 1, c + 1):
            ans.append('C')
            return True
    return False

dfs(0, A, B, C)

if len(ans) > 0:
    print('Yes')
    for x in reversed(ans):
        print(x)
else:
    print('No')
def solve():
    def recur(i, n, total):
        # print("i, n, total", i, n, total)

        if not TABLE[i][n][total] == -1:
            # print('cache!')
            return TABLE[i][n][total]

        if not i < N:
            if n > 0 and total == A * n:
                TABLE[i][n][total] = 1
                return 1
            TABLE[i][n][total] = 0
            return 0

        ans1 = recur(i + 1, n, total)
        ans2 = recur(i + 1, n + 1, total + XS[i])

        # print(ans1, ans2)

        return ans1 + ans2

    N, A = tuple(map(int, input().split()))
    XS = tuple(map(int, input().split()))

    TABLE = []
    for _ in range(N + 1):
        lines = [[-1 for x in range(N * 50 + 1)] for y in range(N + 1)]
        TABLE.append(lines)

    return recur(0, 0, 0)


if __name__ == '__main__':
    print(solve())


### FIXED CODE ###

args = []
for _ in range(4):
    args.append(int(input()))

N, K, X, Y = args


def solve():
    if N <= K:
        return N * X

    first = K
    second = N - first

    return first * X + second * Y

res = solve()
print(res)
five_hundred = int(X / 500)
five = int((X - five_hundred*500)/5)
print(five_hundred*1000+five*5)

### FIXED CODE ###

X = int(input())

five_hundred = int(X / 500)
five = int((X - five_hundred*500)/5)
print(five_hundred*1000+five*5)
N = int(input())
z_t = []*N
t0 = 0
x0 = 0
y0 = 0
ans = 'NO'
for i in range(N):
    s = input().rstrip().split()
    z_t.append(s)

for i in range(N):
    dt = int(z_t[i][0]) - t0
    dx = abs(int(z_t[i][1]) - x0)
    dy = abs(int(z_t[i][2]) - y0)
    extra_t = dt - (dx+dy)

    if extra_t >=  0 and extra_t%2 == 0:
        t0 = int(z_t[i][0])
        x0 = int(z_t[i][1])
        y0 = int(z_t[i][2])
        if i == N-1:
            ans = 'YES'
    else:
        break


print(ans)

### FIXED CODE ###

s = input().rstrip().split(' ')
a = int(s[0])
b = int(s[1])
if a*b%2 == 0:
    print('Even')
else:
    print('Odd')
a,b,c,d = map(int,input().split())

Takahashi=a/d
Aoki=c/b-1                                                                                                                                                                                                                           if Takahashi>=Aoki:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b,c,d = map(int,input().split())
ah=a
ch=c
while(1):
    ah-=d
    ch-=b
    if(ch<=0):
        print("Yes")
        break
    elif(ah<=0):
        print("No")
        break
A, B, K = map(int, input().split())
if A>=K:
    A -= K)
elif A<K  and B>K-A:
    A = 0
    B = B -(K-A)
else:
    A = B = 0
print(A, B, sep=' ')

### FIXED CODE ###

A, B, K = map(int, input().split())
if A>=K:
    A = A - K
    print(A,B)
else:
    K -= A
    A = 0
    B = max(0,B-K)
    print(A,B)
n=int(input())
n=int(input())
s=input()
l=[]

for i in range(n):
    if i==0 or l[-1]!=s[i]:
        l.append(s[i])
print(len(l))

### FIXED CODE ###

n=int(input())
s=input()
t=s[0]
ans=1
for i in range(1,n):
    if t!=s[i]:
        ans+=1
        t=s[i]
print(ans)
mod=10**9+7

n=int(input())

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

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

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

lcma=1

for i in range(n):
    lcma=lcm(lcma,a[i])

ans=0

for i in range(n):
    ans=(ans+lcma//a[i])

print(ans%mod)



### FIXED CODE ###

n=int(input())

m=[[0 for i in range(10)] for j in range(10)]

for i in range(n+1):
    s=int(str(i)[0])
    e=int(str(i)[-1])

    m[s][e]+=1

ans=0

for i in range(10):
    for j in range(10):
        ans+=m[i][j]*m[j][i]

print(ans-1)
print(''.swapcase((<1200)))

### FIXED CODE ###

s = input()
print(s.swapcase())
A,B,C=map(int,input().split())
if B+C=<A:
    print(0)
else:
    print(C+B-A)

### FIXED CODE ###

A,B,C=map(int,input().split())
if B+C <= A:
    print(0)
else:
    print(C+B-A)
a,b=map(int,input().split())
l=[]
if a<b:
  for i in range(a):
    l.append(b)
    l=[str(i) for i in l]
    L=''.join(l)
	print(L)
else:
   for i in range(b):
    l.append(a)
     l=[str(i) for i in l]
    L=''.join(l)
	print(L)
  

### FIXED CODE ###

a,b=map(int,input().split())
if a<b:
  print(str(a)*b)
else:
  print(str(b)*a)