Harryxun/stf_run huggingface dataset:
a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
C = input()
print(a[a.index(C)+1])

### FIXED CODE ###

a = "abcdefghijklmnopqrstuvwxyz"
C = input()
print(a[a.index(C)+1])
n,m = map(int,input().split())
a = []
mod = 10**9+7
for i in range(m):
    a.append(int(input()))

a.append(0)

dp = [0]*(n+1)
dp[0] = 1
if a[0] == 1:
    dp[2] = dp[0]+dp[1]
    l = 1
else:
    dp[1] = dp[0]
    dp[2] = dp[1]+dp[0]
    l = 0
    
for i in range(3,n+1):
    if a[l] != i:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i]%=mod 
    else:
        l += 1
        
print(dp[-1])

### FIXED CODE ###

n,m = map(int,input().split())
a = []
mod = 10**9+7
for i in range(m):
    temp = int(input())
    a.append(temp)

a.append(0)
dp = [0]*(n+1)
dp[0] = 1
if a[0] == 1:
    dp[1] = 0
    l = 1
else:
    dp[1] = dp[0]
    l = 0
    
for i in range(2,n+1):
    if a[l] != i:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i]%=mod 
    else:
        l += 1

print(dp[-1])
n=int(input())
re=0
for i in range(1,n):
  if len(str(i)%2==1):
    re+=1
print(re)

### FIXED CODE ###

n=int(input())
re=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    re+=1
print(re)
INIT = 100

query = []
ans = []
while True:
  q = int(input())
  if q == 0:
    break
  query.append(q)
MAX = max(query)

table = [INIT] * (MAX + 1)
table[0] = 0
all_item = [i * (i + 1) * (i + 2) // 6 for i in range(1, 181)]
odd_item = [i for i in all_item if i % 2]
eve_item = [i for i in all_item if not i % 2]

for v in odd_item:
  for j in range(v, MAX + 1):
    if table[j] > table[j - v] + 1:
      table[j] = table[j - v] + 1

for q in query:
  ans.append(table[q])

for v in eve_item:
  for j in range(v, MAX + 1):
    if table[j] > table[j - v] + 1:
      table[j] = table[j - v] + 1

for i, q in enumerate(query):
  print(table[q], ans[i])


### FIXED CODE ###

def main():
  INIT = 100
  
  query = []
  ans = []
  while True:
    q = int(input())
    if q == 0:
      break
    query.append(q)
  MAX = max(query)
  
  table = [INIT] * (MAX + 1)
  table[0] = 0
  all_item = [i * (i + 1) * (i + 2) // 6 for i in range(1, 181)]
  odd_item = [i for i in all_item if i % 2]
  eve_item = [i for i in all_item if not i % 2]
  
  for v in odd_item:
    for j in range(v, MAX + 1):
      tjv = table[j - v]
      if table[j] > tjv + 1:
        table[j] = tjv + 1
  
  for q in query:
    ans.append(table[q])
  
  for v in eve_item:
    for j in range(v, MAX + 1):
      tjv = table[j - v]
      if table[j] > tjv + 1:
        table[j] = tjv + 1
  
  for i, q in enumerate(query):
    print(table[q], ans[i])

main()
from collections import deque,defaultdict
import bisect
N = int(input())
S = [input() for i in range(N)]

class SegmentTree:
    def __init__(self,data,op,default):
        N = len(data)
        self.N = N
        self.op = op
        self.default = default
        self.l = 2**((N-1).bit_length())
        self.data = [default]*self.l + data + [default]*(self.l-N)
        for i in range(self.l-1,0,-1):
            self.data[i] = op(self.data[2*i], self.data[2*i+1])

    def set(self,i,val):
        i += self.l
        self.data[i] = val
        i = i//2
        while i > 0:
            self.data[i] = self.op(self.data[2*i], self.data[2*i+1])
            i = i//2

    def get(self,i,j):
        i += self.l
        j += self.l
        s = self.default 
        while j-i > 0:
            if i & 1:
                s = self.op(s,self.data[i])
                i += 1
            if j & 1:
                s = self.op(s,self.data[j-1])
                j -= 1
            i = i//2
            j = j//2
        return s

def bend(s):
    res = 0
    k = 0
    for th in s:
        if th == '(':
            k += 1
        else:
            k -= 1
        res = min(k,res)
    return res

LmR = defaultdict(list)
inf = -10**7
for s in S:
    LmR[bend(s)].append(s.count('(')-s.count(')'))
LmR = dict(LmR)
for k in LmR.keys():
    LmR[k].append(inf)
    LmR[k].sort(reverse=True)
    LmR[k] = deque(LmR[k])

keys = sorted(LmR.keys())
nk = len(keys)

comp = {k:i for i,k in enumerate(keys)}
seg = SegmentTree([(LmR[k].popleft(),k) for k in keys], lambda x,y : (x if x[0] > y[0] else y), (inf,inf))

cumsum = 0
for i in range(N):
    ind = bisect.bisect_left(keys,-cumsum)
    m,n = seg.get(ind-1,nk)
    if n == inf:
        print('No')
        exit()
    if cumsum + n < 0:
        print('No')
        exit()
    cumsum += m
    new = LmR[n].popleft()
    seg.set(comp[n], (new,n))

if cumsum == 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

from collections import deque,defaultdict
import bisect
N = int(input())
S = [input() for i in range(N)]

def bend(s):
    res = 0
    k = 0
    for th in s:
        if th == '(':
            k += 1
        else:
            k -= 1
        res = min(k,res)
    return res

species = [(bend(s),s.count('(')-s.count(')')) for s in S]

ups = [(b,u) for b,u in species if u > 0]
flats = [(b,u) for b,u in species if u == 0]
downs = [(b,u) for b,u in species if u < 0]


ups.sort()
high = 0
for b,u in ups[::-1] + flats:
    if high + b < 0:
        print('No')
        exit()
    high += u

rdowns = [(b-u,-u) for b,u in downs]
rdowns.sort()
high2 = 0
for b,u in rdowns[::-1]:
    if high2 + b < 0:
        print('No')
        exit()
    high2 += u

if high == high2:
    print('Yes')
else:
    print('No')
n=(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
import itertools as it
x=0
y=0
for i,j in enumerate(it.permutations(range(1,n+1))):
    if a==j:
        x=i
    if b==j:
        y=i
print(abs(x-y))


### FIXED CODE ###

n=int(input())
a=tuple(map(int,input().split()))
b=tuple(map(int,input().split()))
import itertools as it
x=0
y=0
for i,j in enumerate(it.permutations(list(range(1,n+1)))):
    if a==j:
        x=i
    if b==j:
        y=i
print(abs(x-y))
def rec(n,me,stair):
    if me[n-1]!=0:
        return me[n-1]
    elif n in stair:
        return 0
    elif n==1:
        if n-1 in stair:
            me[n-1]=0
            return 0
        me[n-1]=1
        return 1
    elif n==2:
        test1=n-1 in stair
        test2=n-2 in stair
        if test1 and test2:
            me[n-1]=0
            return 0
        elif test1 or test2:
            me[n-1]=1
            return 1
        me[n-2]=2
        return 2
    else:
        ans=rec(n-2,me,stair)+rec(n-1,me,stair)
        me[n-1]=ans
        return ans

n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
memo=[0]*(n+1)
print(rec(n,memo,a)%1000000007)


### FIXED CODE ###

n,m=map(int,input().split())
stair_m=[True]*(110000)
for i in range(m):
    a=int(input())
    stair_m[a]=False
dp=[0]*(110000)
dp[0]=1
for i in range(1,n+1):
    if stair_m[i]:
        dp[i]=dp[i-1]+dp[i-2]
    else:
        dp[i]=0
print(dp[n]%1000000007)
N=int(input())
ans=0
for i in range(N):
  ans+=(N-1)//i
print(ans)

### FIXED CODE ###

N=int(input())
ans=0
for i in range(1,N):
  ans+=(N-1)//i
print(ans)
d, t, s = map(int, input().split( ))
if d/s <= t:
    print(Yes)
else:
    print(No) 


### FIXED CODE ###

d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')
import numpy as np
H,W,A,B=np.array(list(map(int, input().split())))

for row in range(H):
    L1=np.array([])
    for column in range(W):
        if (B-row)>=0:
            L1=np.append(np.ones(A),np.zeros(W-A))
        else:
            L1=np.append(np.zeross(A),np.ones(W-A))
    L2=np.array(L1, dtype='int64')
    print(''.join(list(map(str, L2))))

### FIXED CODE ###

import numpy as np
H,W,A,B=np.array(list(map(int, input().split())))

for row in range(H):
    if  row<=B-1:
        print(''.join(list(map(str, [1 if i<=A-1 else 0 for i in range(W)]))))
    else:
        print(''.join(list(map(str, [0 if i<=A-1 else 1 for i in range(W)]))))
from collections import deque

N, K = map(int, input().split())
T = [[] for i in range(N)]
E = []
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    T[a].append(b)
    T[b].append(a)
    E.append((a, b))


def bfs(n):
    visited = [False] * N
    dist = [0] * N
    queue = deque([n])
    while queue:
        node = queue.pop()
        if visited[node]:
            continue
        visited[node] = True
        for n in T[node]:
            if not visited[n]:
                dist[n] = dist[node] + 1
                queue.appendleft(n)
    return dist


dist = []
for i in range(N):
    dist.append(bfs(i))

ans = float('inf')
if K % 2 == 0:
    # 全ての頂点について全探索
    for i in range(N):
        ans = min(ans, len(d for d in dist[i] if d > K / 2))
else:
    # 全ての辺について全探索
    for a, b in E:
        adist = [(1 if min(d1, d2) > (K-1) / 2 else 0) for d1, d2 in zip(dist[a], dist[b])]
        ans = min(ans, sum(adist))

print(ans)


### FIXED CODE ###

from collections import deque

N, K = map(int, input().split())
T = [[] for i in range(N)]
E = []
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    T[a].append(b)
    T[b].append(a)
    E.append((a, b))


def dfs(n):
    visited = [False] * N
    stack = [[n, 0]]
    longest = [-1, -1]

    while stack:
        node, weight = stack.pop()
        if visited[node]:
            continue
        visited[node] = True
        if longest[1] < weight:
            longest = [node, weight]

        for n in T[node]:
            if not visited[n]:
                stack.append([n, weight + 1])

    return longest


def bfs(n):
    visited = [False] * N
    dist = [0] * N
    queue = deque([n])
    while queue:
        node = queue.pop()
        if visited[node]:
            continue
        visited[node] = True
        for n in T[node]:
            if not visited[n]:
                dist[n] = dist[node] + 1
                queue.appendleft(n)
    return dist


xn, xw = dfs(0)
yn, yw = dfs(xn)
diameter = yw

d = bfs(0)
ans = float('inf')
if K % 2 == 0:
    # 全ての頂点について全探索
    for i in range(N):
        dist = bfs(i)
        ans = min(ans, len(list(filter(lambda x: K / 2 < x, dist))))
else:
    # 全ての辺について全探索
    for a, b in E:
        dist1 = bfs(a)
        dist2 = bfs(b)
        dist = [min(d1, d2) for d1, d2 in zip(dist1, dist2)]
        ans = min(ans, len(list(filter(lambda x: (K-1) / 2 < x, dist))))

print(ans)
import math
class Vertice:
  def __init__(self, num):
    self.num = num
    self.connected = []
    self.edge = []
    self.pos = math.inf
    
def DFS(vertice):
  judge = True
  for con in vertice.connected:
    index = vertice.connected.index(con)
    if con.pos == math.inf:
      con.pos = vertice.pos + vertice.edge[index]
      judge = DFS(con)
    elif con.pos != vertice.pos + vertice.edge[index]:
      judge = False
    if judge == False:
      break
  return judge

N, M = (int(_) for _ in input().split())
vertices = [Vertice(i) for i in range(N)]
L, R, D = ([None for i in range(M)] for j in range(3))
for i in range(M):
  L[i], R[i], D[i] = (int(_) for _ in input().split())
for i in range(M):
  if not vertices[R[i] - 1] in vertices[L[i] - 1].connected:
    vertices[L[i] - 1].connected.append(vertices[R[i] - 1])
    vertices[R[i] - 1].connected.append(vertices[L[i] - 1])
    vertices[L[i] - 1].edge.append(D[i])
    vertices[R[i] - 1].edge.append(-D[i])
judge = True
for i in range(N):
  if vertices[i].pos == math.inf:
    vertices[i].pos = 0
    judge = DFS(vertices[i])
    if judge == False:
      break
if judge:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000002)

def DFS(i, pos, connected, distances):
  if pos[i] == None:
    pos[i] = 0
  size = len(connected[i])
  for j in range(size):
    if pos[connected[i][j]] == None:
      pos[connected[i][j]] = pos[i] + distances[i][j]
      if DFS(connected[i][j], pos, connected, distances) == False:
        return False
    elif pos[connected[i][j]] != pos[i] + distances[i][j]:
      return False
  return True

N, M = map(int, input().split())
pos = [None for i in range(N + 1)]
connected = [[] for i in range(N + 1)]
distances = [[] for i in range(N + 1)]
for i in range(M):
  l, r, d = map(int, input().split())
  connected[l].append(r)
  distances[l].append(d)
  connected[r].append(l)
  distances[r].append(-d)
judge = True
for i in range(1, N + 1):
  if pos[i] == None:
    judge = DFS(i, pos, connected, distances)
    if judge == False:
      break
if judge:
  print('Yes')
else:
  print('No')
nums = [int(i) for i in input().split()]
nums.sort
print( %d %d %d % nums)

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
 
if a > b:
    tmp = a
    a = b
    b = tmp
if b > c:
    tmp = b
    b = c
    c = tmp
if a > b:
    tmp = a
    a = b
    b = tmp
 
print(a, b, c)
import sys
rawdata=sys.stdin.readline()
rawdata.rstrip('\n')
line=list(map(int,list(rawdata)))
line=list(map(int,list(str(input()))))
length=len(line)
while True:
  line2=[]
  for i in range(len(line)-1):
    if line[i]!=2 and line[i]!=line[i+1]:
      line[i]=2
      line[i+1]=2
    elif line[i]!=2:
      line2.append(line[i])
  if len(line)!=0 and line[len(line)-1]!=2:
      line2.append(line[len(line)-1])
  if 2 in line:
    line=[i for i in line2]
  else:
    break
print(length-len(line))

### FIXED CODE ###

s=str(input())
if s.count('1')>s.count('0'):
    print(s.count('0')*2)
else:
    print(s.count('1')*2)
import numpy as np


h, n = map(int, input().split())
a = np.zeros(n, dtype=int)
b = np.zeros(n, dtype=int)
for i in range(n):
    a[i], b[i] = map(int, input().split())
dp = np.zeros(10001, dtype=int)
for i in range(1, 10001):
    dp[i] = (dp[i - a] + b).min()
print(dp[h])


### FIXED CODE ###

# coding=utf-8
# Date: 2020-01-08
# Author: lee215

get = lambda: int(raw_input().strip())
getl = lambda: raw_input().strip()
gets = lambda: map(int, raw_input().strip().split())
getss = lambda n: [gets() for _ in xrange(n)]

H, N = gets()
AB = getss(N)
AB.sort(key=lambda a_b: -a_b[0] * 1.0 / a_b[1])

a0, b0 = AB[0]
dp = [0] + [float('inf')] * (H + a0)

cur = 0
while cur <= H + a0:
    dp[cur] = cur / a0 * b0
    cur += a0


for a, b in AB[1:]:
    for i in xrange(a, H + a0 + 1):
        dp[i] = min(dp[i], dp[i - a] + b)
print min(dp[H:])
import copy
n,m=map(int,input().split())
a=[[0 for _ in range(m+2)] for _ in range(n+2)]
a[0][0]=1
a[1][2]=1
for i in range(1,n):
  b=copy.deepcopy(a)
  for j in range(0,i+2):
    for k in range(0,m+1):
      if k>=2*j:
        a[j][k]=(2*j+1)*b[j][k-2*j]+(j+1)**2*b[j+1][k-2*j]
        if j>0:
          a[j][k]+=b[j-1][k-2*j]
      else:
        a[j][k]=0
print(a[0][m]%(10**9+7))

### FIXED CODE ###

import copy
n,m=map(int,input().split())
a=[[0 for _ in range(m+3)] for _ in range(n+2)]
a[0][0]=1
a[1][2]=1
for i in range(1,n):
  b=copy.deepcopy(a)
  for j in range(0,i+2):
    for k in range(0,m+1):
      if k>=2*j:
        a[j][k]=(2*j+1)*b[j][k-2*j]+(j+1)**2*b[j+1][k-2*j]
        if j>0:
          a[j][k]+=b[j-1][k-2*j]
        a[j][k]%=(10**9+7)
      else:
        a[j][k]=0
print(a[0][m])
x=int(input())
a=int(input())
b=ibt(input())

print((x-a)%b)

### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)
N=int(input())
A=list(map(int,input().split()))
m=10**9+7
r=1
C=[0,0,0]
for a in A:
    i=C.index(a)
    r=r*sum([1 if c==a else 0 for c in C])%m
    C[i]+=1
print(r)

### FIXED CODE ###

N=int(input())
A=map(int,input().split())
m=10**9+7
r=1
C=[0,0,0]
for a in A:
    try:
        i=C.index(a)
        r=r*sum([1 if c==a else 0 for c in C])%m
        C[i]+=1
    except:
        print(0)
        exit()
print(r)
import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    D = [0] * (N+1)
    for i in range(2, N+1):
        D[i] = i*(i+1)//2

    index = bisect_left(D, N)
    if N != D[index]:
        print("No")
    else:
        print("Yes")
        print(index+1)
        D2 = Init(index+1, index,0)
        D2[0] = [i for i in range(1, index+1)]
        num = index
        
        for i in range(1, index+1):
            for j in range(i):
                D2[i][j] = D2[j][i-1]
            for k in range(j+1, index):
                num += 1
                D2[i][k] = num
        
        for temp in D2:
            temp = [index]+temp
            temp = [str(i) for i in temp]
            print(" ".join(temp))

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    D = [0] * (N+1)
    for i in range(1, N+1):
        D[i] = i*(i+1)//2

    index = bisect_left(D, N)
    if N != D[index]:
        print("No")
    else:
        print("Yes")
        print(index+1)
        D2 = Init(index+1, index,0)
        D2[0] = [i for i in range(1, index+1)]
        num = index
        for i in range(1, index+1):
            for j in range(i):
                D2[i][j] = D2[j][i-1]
            for k in range(j+1, index):
                num += 1
                D2[i][k] = num
        for temp in D2:
            temp = [index]+temp
            temp = [str(i) for i in temp]
            print(" ".join(temp))

if __name__ == "__main__":
    main()
AB = input().split()
A = intAB[0]
B = intAB[1]

if 1 <= A <= 9 and 1 <= B <= 9 :
    print(A * B)

else :
    print(-1)

### FIXED CODE ###

AB = input().split()
A = int(AB[0])
B = int(AB[1])

if 1 <= A <= 9 and 1 <= B <= 9 :
    print(A * B)

else :
    print(-1)
A = input('A=: ')
B = input('B=: ')
if not((1<=A<=100) && (1<=B<=100)):
    print("1<=A,B<=100")
    A = input('A=: ')
    B = input('B=: ')

### FIXED CODE ###

A,B=input().split()
length = int(A) - 2 * int(B)
if length < 0:
    print(0)
else:
    print(length)
# coding: utf-8
import numpy as np


def solve(*args: str) -> str:
    n, m = map(int, args[0].split())
    prices = list(map(lambda _: int(_.split()[0]), args[1::2]))
    targets = []
    for C in args[2::2]:
        b = np.array([0 for _ in range(n)])
        for i in map(int, C.split()):
            b[i-1] = 1
        # b = 0
        # for ci in map(int, C.split()):
        #     b += 2**ci
        targets.append(b)

    s = np.array([0 for _ in range(n)])
    for t in targets:
        s += t

    if not all(map(lambda x: x > 0, s)):
        return str(-1)

    total = sum(prices)

    keys = sorted(zip(prices, targets))
    for k in reversed(keys):
        p, t = k
        if all(map(lambda x: x > 0, s-t)):
            total -= p
            s = s-t

    # if len(set(itertools.chain.from_iterable(targets))) != n:
    #     return str(-1)

    return str(total)


if __name__ == "__main__":
    nm = input()
    _, m = map(int, nm.split())
    print(solve(*([nm]+[input() for _ in range(2*m)])))


### FIXED CODE ###

# coding: utf-8
from functools import reduce


def solve(*args: str) -> str:
    a_max = 1+12*10**5
    n, m = map(int, args[0].split())
    cache = {}

    for i in range(1, 1+2*m, 2):
        a, _ = map(int, args[i].split())
        c = reduce(
            lambda x, y: x | 1 << y-1,
            [0] + list(map(int, args[i+1].split()))
        )
        cache[c] = min(cache.get(c, a_max), a)

    for C in tuple(cache.items()):
        unlocked, cost = C
        for E in tuple(cache.items()):
            c, a = E
            cache[unlocked | c] = min(
                cache.get(unlocked | c, a_max),
                a + cost
            )

    return str(cache.get(2**n-1, -1))


if __name__ == "__main__":
    nm = input()
    _, m = map(int, nm.split())
    print(solve(*([nm]+[input() for _ in range(2*m)])))
import math
import collections

def fact(n):
    c = []
    while n % 2 == 0:
        c.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            c.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        c.append(n)
    return c

a, b = map(int, input().split())
g = math.gcd(a, b)
c = collections.Counter(fact(g))

print(len(c)+1)

### FIXED CODE ###

import fractions
import collections

def fact(n):
    c = []
    while n % 2 == 0:
        c.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            c.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        c.append(n)
    return c

a, b = map(int, input().split())
g = fractions.gcd(a, b)
c = collections.Counter(fact(g))

print(len(c)+1)
def func():
    return

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

ans = ""
if a <= b:
    for i in b:
        ans += str(a)
else:
    for j in a:
        ans += str(b)

print(ans)



### FIXED CODE ###

def func():
    return

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

ans = ""
if a <= b:
    for i in range(b):
        ans += str(a)
else:
    for j in range(a):
        ans += str(b)

print(ans)
n = int(input())
list = []
for xi in range(n):
    add1, add2 = input().split()
    add = [add2, add1, xi+1]
    list.append(add)
list.sort(key=lambda list2: list2[1])


name = list[0][1]
list2 = [list[0]]
count = 1
for xi in range(1,n):
    if name == list[xi][1]:
        list2.append(list[xi])
        count += 1
    else:
        list2.sort(key=int, reverse=True)
        for yi in range(count-1,-1,-1):
            print(list2[yi][2])
        name = list[xi][1]
        list2 = [list[xi]]
        count = 1

if len(list2)<n:
    list2.sort(key=int, reverse=True)
for yi in range(count-1,-1,-1):
    print(list2[yi][2])
name = list[xi][1]
list2 = [list[xi]]
count = 1


### FIXED CODE ###

n = int(input())
list = []
for xi in range(n):
    add1, add2 = input().split()
    add = [int(add2), add1, xi+1]
    list.append(add)
list.sort(key=lambda list2: list2[1])


name = list[0][1]
list2 = [list[0]]
count = 1
for xi in range(1,n):
    if name == list[xi][1]:
        list2.append(list[xi])
        count += 1
    else:
        list2.sort()
        for yi in range(count-1,-1,-1):
            print(list2[yi][2])
        name = list[xi][1]
        list2 = [list[xi]]
        count = 1

if len(list2)<n:
    list2.sort()
for yi in range(count-1,-1,-1):
    print(list2[yi][2])
name = list[xi][1]
list2 = [list[xi]]
count = 1
import math
A, B, H, M = [int(i) for i in input().split()]
h = H* 2*math.pi/12 #rad
m = M* 2*math.pi/60 #rad
#print(h, "\n", m)
#def kyori(a,b,c,d):
#    return math.sqrt(a**2+b**2-2*a*b*math.cos(c-d))

print(math.sqrt(a**2+b**2-2*a*b*math.cos(c-d)))



### FIXED CODE ###

import math

def kyori(a,b,c,d):
    return math.sqrt(a**2+b**2-2*a*b*math.cos(abs(c-d)))

A, B, H, M = [int(i) for i in input().split()]
m = M* 2*math.pi/60 #rad
h = H* 2*math.pi/12+ M*2*math.pi/60/12 #rad
#print(h, "\n", m)


k=kyori(A,B,h,m)
print(k)