Harryxun/stf_run huggingface dataset:
(w, h, x, y, r) = input().sprit(' ')
w = int(w)
h = int(h)
x = int(x)
y = int(y)
r = int(r)

if 0 + r <= x <= w - r and 0 + r <= y <= h - r:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

(w, h, x, y, r) = input().split(' ')
w = int(w)
h = int(h)
x = int(x)
y = int(y)
r = int(r)

if 0 + r <= x <= w - r and 0 + r <= y <= h - r:
    print('Yes')
else:
    print('No')
ab=input()
print(ab.split(' ')[0]*ab.split(' ')[1]+" "+(ab.split(' ')[0]+ab.split(' ')[1])*2)


### FIXED CODE ###

ab=input()
a=int(ab.split()[0])
b=int(ab.split()[1])
s=a*b
l=(a+b)*2
print("{0} {1}".format(s,l))
import fraction

N, X = [int(n) for n in input().split()]
x = sorted([abs(int(n) - X) for n in input().split()])

if len(x) > 1:
  gcd = fraction.gcd(x[0], x[1])
  for i in x:
    gcd = fraction.gcd(gcd, i)
else:
  gcd = x[0]
print(gcd)

### FIXED CODE ###

import fractions

N, X = [int(n) for n in input().split()]
x = sorted([abs(int(n) - X) for n in input().split()])

if len(x) > 1:
  gcd = fractions.gcd(x[0], x[1])
  for i in x:
    gcd = fractions.gcd(gcd, i)
else:
  gcd = x[0]
print(gcd)
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

#読書時間を机A,Bそれぞれについて上から順に加算
A_min = [0]
for i in range(N):
  A_min.append(A_min[i]+A[i])
B_min = [0]
for i in range(M):
  B_min.append(B_min[i]+B[i])

#A_min,B_minを順に加算して、Kを超えていなければ冊数を更新
ans = 0
B_len = len(B_min)
for i in range(len(A_min)):
  if Amin[i] > K:
    break
  while true:
    if B_min[B_len] > K - A_min[i]:
      break
    ans = max(ans,i+B_len)

print(ans)

### FIXED CODE ###

N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

#読書時間を机A,Bそれぞれについて上から順に加算
A_min = [0]
for i in range(N):
  A_min.append(A_min[i]+A[i])
B_min = [0]
for i in range(M):
  B_min.append(B_min[i]+B[i])

#A_min,B_minを順に加算して、Kを超えていなければ冊数を更新
ans = 0
B_len = M
for i in range(len(A_min)):
  if A_min[i] > K:
    break
  while B_min[B_len] > K - A_min[i]:
    B_len -= 1
  ans = max(ans,i+B_len)
print(ans)
n, x, *m = map(int, open(0).read().split())
ans = -1
for i in sorted(m):
    if x>=i:
        x -= i                                                                                                                                                                                ans+=1
print(ans+x//min(m))

### FIXED CODE ###

n, x, *m = map(int, open(0).read().split())
ans = 0
for i in sorted(m):
    if x>=i:
        x -= i
        ans+=1
mx = min(m)
print(ans + (x//mx))
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
ans = 0
 
for i in range(n):
  temp = a[i]
  temp_list = np.array([a[:i]])
  temp_list = np.append(temp_list,a[i+1:])
  
  if np.any(temp%temp_list == 0):
    continue
  else:
    ans += 1
    
print(ans)

### FIXED CODE ###

import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

#@njit
def slove(A):
  count = np.zeros(10**6 + 10, np.int32)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ret = 0
  for x in A:
    ret += count[x] == 1
  return ret

A = np.array(read().split(), np.int32)[1:]

print(slove(A))
N, M = [int(i) for i in input().split()]
di = {}
flag = True
for _ in range(M):
    s, c = [int(i) for i in input().split()]
    if(s in di):
        if(di[s] != c):
            print(-1)
            flag = False
            break
    else:
        di[s] = c

if(1 in di):
    if(di[1]==0):
        print(-1)
        break

if(flag):
    for i in range(10**(N-1), 10**N):
        x = str(i)
        ok = True
        for ind, s in enumerate(x):
            if(ind+1 in di):
                if(di[ind+1] != int(s)):
                    ok = False
                    continue
        if(ok):
            print(i)
            break
    else:
        print(-1)




### FIXED CODE ###

N, M = [int(i) for i in input().split()]
di = {}
flag = True
for _ in range(M):
    s, c = [int(i) for i in input().split()]
    if(s in di):
        if(di[s] != c):
            print(-1)
            flag = False
            break
    else:
        di[s] = c

if(1 in di):
    if(di[1]==0):
        if(N==1):
            print(0)
        else:
            print(-1)
        flag = False

if(N==1 and M==0):
    print(0)
    flag=False

if(flag):
    for i in range(10**(N-1), 10**N):
        x = str(i)
        ok = True
        for ind, s in enumerate(x):
            if(ind+1 in di):
                if(di[ind+1] != int(s)):
                    ok = False
                    continue
        if(ok):
            print(i)
            break
    else:
        print(-1)
N,K = list(map(int,input().split()))
R = list(map(int,input().split()))
R.sort(reverse=True)
for i in range(K):
    R[i] = 0
print(sum(R))

### FIXED CODE ###

N,K = list(map(int,input().split()))
R = list(map(int,input().split()))
R.sort(reverse=True)
if N < K:
    print(0)
    exit()
for i in range(K):
    R[i] = 0
print(sum(R))
n = int(input())
x,y = 0, 0
tf = 0
hantei = False
for i in range(n):
    t,a,b = list(map(int, input().split()))
    if (a + b) > t or (a + b + t) % 2 == 1:
        print('No')
        exit()
print('Yes')

### FIXED CODE ###

a, b = map(int,input().split())
if (a * b) % 2 == 0:
    print('Even')
else:
    print('Odd')
def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return int(a*b/fcd(a , b))


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1])

### FIXED CODE ###

def fcd(a , b):
    
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


n = int(input())
t_list = []
ans_list = []
for i in range(n):
    t_list.append(int(input()))
    
    
for i in range(len(t_list)):
    if i == 0:
        ans_list.append(t_list[0])
        continue
    if i == 1:
        ans_list.append(lcm(t_list[0] , t_list[1]))
    
    if i >=2:
        ans_list.append(lcm(ans_list[-1],t_list[i]))
print(ans_list[-1])
import sys
# input = sys.stdin.buffer.readline
def input(): return sys.stdin.readline().rstrip()
sys.setrecursionlimit(10 ** 7)

MAX = 500   # (80+80)*80=240
MID = 250   # 250を0とする
H, W = map(int, input().split())
A = [[int(x) for x in input().split()] for _ in range(H)]
B = [[int(x) for x in input().split()] for _ in range(H)]
C = [[0] * W for _ in range(H)]
for i in range(H):
    for j in range(W):
        C[i][j] = abs(A[i][j] - B[i][j])

dp = [[[0]*500 for _ in range(W)] for _ in range(H)]
dp[0][0][MID+C[0][0]] = 1
dp[0][0][MID-C[0][0]] = 1
for i in range(H):
    for j in range(W):
        if i:
            for k in range(MAX):
                if dp[i-1][j][k] == 1:
                    dp[i][j][k+C[i][j]] = 1
                    dp[i][j][k-C[i][j]] = 1
        if j:
            for k in range(MAX):
                if dp[i][j-1][k] == 1:
                    dp[i][j][k+C[i][j]] = 1
                    dp[i][j][k-C[i][j]] = 1
ans = MAX
for i in range(MAX):
    if dp[H-1][W-1][i] == 1:
        ans = min(ans, abs(i-MID))
print(ans)

### FIXED CODE ###

H, W = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]
B = [list(map(int, input().split())) for i in range(H)]
center = 80 * (H+W)
C = [[abs(A[i][j] - B[i][j]) for j in range(W)] for i in range(H)]

dp = [[0] * W for i in range(H)]
dp[0][0] = (1 << (center + C[0][0])) | (1 >> (center - C[0][0]))

for i in range(H):
    for j in range(W):
        if i:
            dp[i][j] |= dp[i-1][j] << C[i][j]
            dp[i][j] |= dp[i-1][j] >> C[i][j]
        if j:
            dp[i][j] |= dp[i][j-1] << C[i][j]
            dp[i][j] |= dp[i][j-1] >> C[i][j]

ans = center * 2
for i in range(center*2):
    if (dp[H-1][W-1] >> i) & 1:
        ans = min(ans, abs(i-center))

print(ans)
from collections import deque

N = int(input())
A = deque()
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

value_A = A[0][0] + A[0][1]
value_B = A[0][0] + A[1][0]

for i in range(2, N):
    value_C = value_A + A[1][i-1]
    value_A += A[0][i]
    value_B += A[1][i-1]

    if value_B < value_C:
        value_B = value_C

print(str(max(value_A, value_B, value_C) + A[1][N-1]))

### FIXED CODE ###

N = int(input())

A = []
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N > 1:
    up = A[0][1]
    down = A[1][0]

    for i in range(1, N-1):
        up_ = up + A[1][i]
        down += A[1][i]
        up += A[0][i+1]

        down = max(down, up_)

    print(max(up, down)+A[0][0]+A[1][N-1])
else:
    print(A[0][0]+A[1][0])
# coding: utf-8

N=input()
A=input()

print(str((N**2)-A))

### FIXED CODE ###

N=int(input())

print((N*N)-int(input()))
#                         author:  kagemeka 
#                         created: 2019-11-10 12:28:14(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   
# import scipy.misc      
# import numpy as np 

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    if (a * b) % 2 !- 0:
        ans = 'Yes'
    else:
        ans = 'No'
    
    print(ans)


if __name__ == "__main__":
    # execute only if run as a script
    main()


### FIXED CODE ###

#                         author:  kagemeka 
#                         created: 2019-11-10 12:28:14(JST)
### modules
## from standard library
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   
# import scipy.misc      
# import numpy as np 

def main():
    a, b = (int(x) for x in sys.stdin.readline().split())
    if (a * b) % 2 != 0:
        ans = 'Yes'
    else:
        ans = 'No'
    
    print(ans)


if __name__ == "__main__":
    # execute only if run as a script
    main()
from collections import deque

def prepare(n, MOD):
 
    # 1! - n! の計算
    f = 1
    factorials = [1]  # 0!の分
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    # n!^-1 の計算
    inv = pow(f, MOD - 2, MOD)
    # n!^-1 - 1!^-1 の計算
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv
     
    return factorials, invs


MOD = 10**9+7
fact, fact_inv = prepare(10+10**5, MOD)


n, k = map(int,input().split())
e = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int,input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)
    
colored = [False]*n
# 根を決める
for i in range(n):
    if len(e[i]) == 1:
        s = i
colored[s] = True
ans = k
num = len(e[s])
ans *= fact[k-1] * fact_inv[k-1-num] % MOD
ans %= MOD
d = deque()
for i in e[0]:
    colored[i] = True
    d.append(i)
while d:
    f = d.pop()
    num = len(e[f]) - 1
    if num == 0:
        continue
    ans *= fact[k-2] * fact_inv[k-2-num] % MOD
    ans %= MOD
    for i in e[f]:
        if not colored[i]:
            colored[i] = True
            d.append(i)
print(ans % MOD)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 08:44:21 2020

@author: teppe
"""

from collections import deque

def prepare(n, MOD):
 
    # 1! - n! の計算
    f = 1
    factorials = [1]  # 0!の分
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    # n!^-1 の計算
    inv = pow(f, MOD - 2, MOD)
    # n!^-1 - 1!^-1 の計算
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv
     
    return factorials, invs

MOD = 10**9+7
fact, fact_inv = prepare(10+10**5, MOD)

def perm(n,k):
  if k > n or k < 0:
    return 0
  return fact[n] * fact_inv[n-k] % MOD


n, k = map(int,input().split())
e = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int,input().split())
    a -= 1
    b -= 1
    e[a].append(b)
    e[b].append(a)
 
colored = [False]*n
colored[0] = True
num = len(e[0])
ans = perm(k, 1+num)
d = deque()
for i in e[0]:
    colored[i] = True
    d.append(i)
while d:
    f = d.pop()
    num = len(e[f]) - 1
    if num == 0:
        continue
    ans *= perm(k-2, num)
    ans %= MOD
    for i in e[f]:
        if not colored[i]:
            colored[i] = True
            d.appendleft(i)
print(ans % MOD)
# import sys
import math
# import itertools
# from collections import deque
# from collections import defaultdict
# import heapq
# import copy
# import bisect
# import numpy as np
# from scipy.special import comb

# def my_input(): return sys.stdin.readline().rstrip()
# sys.setrecursionlimit(100000)
# INF = 1001001001001
# MOD = 1000000007


def main():

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


if __name__ == '__main__':
    main()


### FIXED CODE ###

import fractions

A, B = map(int, input().split())
lcm = A * B // fractions.gcd(A, B)
print(lcm)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N,M = map(int,input().split())
S = str(input())
T = str(input())

L = lcm(N,M)
if L == max(N,M):
  L *= 2
X = [""]*L
if S[0] != T[0]:
  print(-1)
  exit()
else:
  X[0] = S[0]

for i in range(1,N):
  X[i*L//N] = S[i]
for j in range(1,M):
  if X[j*L//M] == "" or X[j*L//M] == T[j]:
    pass
  else:
    print(-1)
    exit()

print(L)

### FIXED CODE ###

import math
 
N,M = map(int,input().split())
S = list(str(input()))
T = list(str(input()))
g = math.gcd(N,M)
gn,gm = N//g,M//g
for i in range(g):
  if S[i*gn] != T[i*gm]:
    print(-1)
    exit()

print(gn*gm*g)
# ABC136B

n = int(input())
if n <= 9:
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 + n - 99)
elif n <= 9999:
    print(909
elif n <= 99999:
    print(909 + n - 9999)
else:
    print(90909)


### FIXED CODE ###

# ABC136B

n = int(input())
if n <= 9:
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 + n - 99)
elif n <= 9999:
    print(909)
elif n <= 99999:
    print(909 + n - 9999)
else:
    print(90909)
import copy

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

frends = {}

for i in range(m):
  a,b = map(int, input().split())
  if a not in frends:
    frends[a] = set([a])
  if b not in frends:
    frends[b] = set([b])
  frends[a].add(b)
  frends[b].add(a)

group = copy.copy(frends) 
  
for i in frends:
  flag = False
  r = group[i]
  for j in r:
    if j > i:
      flag = True
      break
  if flag == True:
    group[max(r)].update(group.pop(i))

    
cnt = 0
for i in group:
  c = len(group[i])
  if c > cnt:
    cnt = c

print(cnt)

### FIXED CODE ###

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

def same(x, y):
    return find(x) == find(y)

def unite(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    if par[x] > par[y]:
        x, y = y, x
    par[x] += par[y]
    par[y] = x


N, M = map(int, input().split())
par = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    unite(a - 1, b - 1)

print(-min(par))
A,B,C=map(str,input().split())
if len(A)>=0:
    print(C,A,B)

### FIXED CODE ###

A,B,C=map(str,input().split())
if len(A)>=0:
    print(C,A,B)
S = str(input())
T = str(input())

suma=0
sumb=0
sumc=0

for i in range(len(T)):
    A = T[i:]
    B = T[:i+1]
    if A in S:
        pass
    else:
        suma+=1

    if B in S:
        pass
    else:
        sumb+=1

    if A in S:
        if B in S:
            pass
    else:
        sumc+=1


suma = min(suma, sumb)
suma = min(suma, sumc)
print(suma)
~             

### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(S: str, T: str):
    length = len(T)
    s_list =[]
    counter = length
    ans = 0

    for i in range(len(S)-length+1):
        s = S[i:i+length]
        for i in range(length):
            #print(s[i], T[i])
            if s[i] != T[i]:
                ans+=1

        counter = min(ans, counter)

        ans = 0

    return print(counter)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    solve(S, T)

if __name__ == '__main__':
    main()
if B >= 1 and A >= B and A <= 20 and C >= 1 and C <= 20:
    capacity = A - B
    if capacity <= C:
        remaining = C - capacity
    else:
        remaining = 0
    print(remaining)

### FIXED CODE ###

A,B,C = map(int, input().split())
if B >= 1 and A >= B and A <= 20 and C >= 1 and C <= 20:
    capacity = A - B
    if capacity <= C:
        remaining = C - capacity
    else:
        remaining = 0
    print(remaining)
def dfs(cur_node, candidates, visited, level, cnt):

  while len(candidates) > 0:
    node, level = candidates.pop(0)

    if visited[node]: continue
    visited[node] = True

    if level > 0: cnt += 1

    for n in adj_list[node][FRIEND]:
      if n in adj_list[cur_node][BLOCK]:
        candidates.append((n, 0))
      if visited[n] == False:
        candidates.append((n, level+1))

  return cnt

# -----------------------------------------

FRIEND, BLOCK = 0, 1

N, F, B = list(map(int, input().split()))
adj_list = defaultdict(dict)
for i in range(1, N+1):
  adj_list[i][0] = set()
  adj_list[i][1] = set()

for _ in range(F):
  u, v = list(map(int, input().split()))
  adj_list[u][FRIEND].add(v)
  adj_list[v][FRIEND].add(u)

for _ in range(B):
  u, v = list(map(int, input().split()))
  adj_list[u][BLOCK].add(v)
  adj_list[v][BLOCK].add(u)

ans = []

for i in range(1, N+1):
  visited = [False] * (N+1)
  visited[i] = True
  candidates = []
  for node in adj_list[i][FRIEND]:
    # node, level
    candidates.append((node, 0))

  cnt = 0
  cnt = dfs(i, candidates, visited, 0, 0)
  ans.append(cnt)

print(" ".join([str(i) for i in ans]))

### FIXED CODE ###

class UF():
  def __init__(self, N):
    self.par = [-1] * N

  def union(self, x, y):
    p1,p2 = self.find(x), self.find(y)
    if p1 == p2: return

    if self.par[p1] > self.par[p2]:
      p1,p2 = p2,p1
    self.par[p1] += self.par[p2]
    self.par[p2] = p1

  def find(self, x):
    if self.par[x] < 0:
      return x
    else:
      self.par[x] = self.find(self.par[x])
      return self.par[x]

  def size(self, x):
    return -self.par[self.find(x)]

  def same(self, x, y):
    return self.find(x) == self.find(y)

N,M,K = map(int,input().split())
uf = UF(N)
adj = [ [] for _ in range(N)]
for _ in range(M):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  adj[u].append(v)
  adj[v].append(u)
  uf.union(u,v)

res = []
for n in range(N):
  res.append(uf.size(n) - 1 - len(adj[n]))

for _ in range(K):
  u,v = map(int,input().split())
  u -= 1
  v -= 1
  if uf.same(u,v):
    res[u] -= 1
    res[v] -= 1

print(" ".join(map(str, res)))
n = map(int,input().split(" "))
if n==1:
    print("1.0")
elif n%2 == 0:
    print("0.5")
else:
    print("0.6")

### FIXED CODE ###

a = int(input())
if a%2 == 0:
    print(0.5)
else:
    b = (int(a/2)+1)/a
    print(b)
import fractions

def lcm(x,y):
    return (x*y) // fractions.gcd(x, y)
    
x, y = map(int, input().split())
s = input()
t = input()

check = [""] * (10**6)
lc = lcm(x,y)

s_l = lc//x
t_l = lc//y

for i in range(x):
    check[i*s_l + 1] = s[i]
    
for i in range(y):
    if check[i*t_l + 1] != t[i] and check[i*t_l + 1] != "":
        print(-1)
        break
else:
    print(lc)



### FIXED CODE ###

import fractions

def lcm(x,y):
    return (x*y) // fractions.gcd(x, y)
    
x, y = map(int, input().split())
s = input()
t = input()

lc = lcm(x,y)

s_l = lc//x
t_l = lc//y

for i in range(y):
    if i%s_l == 0:
        if t[i] == s[i*t_l//s_l]:
            continue
        else:
            print(-1)
            break
else:
    print(lc)
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
def main():
  for i in range(A):
    if A[i]+1==A[i+1]:
      B[A[i+1]]=B[A[i+1]]+C[i]
  print(sum(B[A[i]])
main()

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
temp=""
for i in A:
  s+=B[i-1]
  if temp==i-1:
    s+=C[temp-1]
  temp=i
print(s)
from string import ascii_lowercase

s = input()
d = dict(zip(ascii_lowercase, [0 for _ in range(len(ascii_lowercase))]))

for c in s:
    d[c] += 1

if len(s) < 26:
    for k, v in d.items():
        if v == 0:
            print(s + k)
            exit()
elif s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

idx = -1
for i in range(1, len(s)):
    if s[i] > s[i + 1]:
        idx = i
        break
check = dict(zip(ascii_lowercase, [False for _ in range(len(ascii_lowercase))]))
for i in range(idx):
    check[s[i]] = True
i = 0
for c, v in check.items():
    if v == False:
        print(s[: i - 1] + c)
        exit()
    i += 1


### FIXED CODE ###

from string import ascii_lowercase
alphabets = ascii_lowercase
s = input()
if len(s) < len(alphabets):
    for c in alphabets:
        if c not in s:
            print(s + c)
            exit()
if s == "zyxwvutsrqponmlkjihgfedcba":
    print(-1)
    exit()

# 14253 next 143,  54213 next 5423, 35421 next 4, 43521 next 45
# 右端からみてi-1, iを比較して減少(S[i]>S[i-1])してたらi-1を基準に切り替える
# 切り替えるのは勘だけどi-1より右側でi-1より大きい最小のやつ？
for i in range(len(s) - 1, 0, -1):
    if s[i] > s[i - 1]:
        t = []
        for j in range(i, len(s)):
            if s[i - 1] < s[j]:
                t.append(s[j])
        x = min(t)
        print(s[:i - 1] + x)
        exit()
import collections

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

if n == 0:
    print(x)
    exit()
    
p = list(map(int, input().split()))
l = [i for i in range(1, 101)]

def calc(a):
    return abs(a - x)

if x in l:
    l.remove(x) 
for i in p:
    if i in l:
        l.remove(i)

l2 = list(map(calc, l))
m = min(l2)

if collections.Counter(l2)[m] == 2:
    print(-m + x)
else:
    print(m + x)


### FIXED CODE ###

x, n = map(int, input().split())
if n != 0:
    l = list(map(int, input().split()))
else:
    l = []

diff = 10**18
ans = 10**18

for i in range(-10000, 10000):
    if i in l:
        continue
    else:
        if abs(x-i) < diff:
            ans = i
            diff = abs(x-i)

print(ans)
n=input()
ans=0
def dfs(i,flag):
  global ans
  if i!=len(n)-1:
    dfs(i+1,flag)
    dfs(i+1,flag|2**i)
  else:
    num=[]
    start=0
    for i in range(len(n)):
      if flag&2**i>0:
        num.append(n[start:i+1])
        start=i+1
    ans+=sum(num)

dfs(0,0)
print(ans)

### FIXED CODE ###

n=input()
ans=0
def dfs(i,flag):
  global ans
  if i!=len(n)-1:
    dfs(i+1,flag)
    dfs(i+1,flag|2**i)
  else:
    num=[]
    start=0
    for i in range(len(n)):
      if flag&2**i>0:
        num.append(int(n[start:i+1]))
        start=i+1
    if start!=n:
      num.append(int(n[start:]))
    ans+=sum(num)
dfs(0,0)
print(ans)
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

ans = 1
cnt = [0, 0, 0]
for i in a:
    ans *= cnt.count(i)
    cnt[cnt.index(i)] += 1
    ans %= mod
print(ans)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

ans = 1
cnt = [0, 0, 0]
for i in a:
    ans *= cnt.count(i)
    for j in range(3):
        if cnt[j] == i:
            cnt[j] += 1
            break
    ans %= mod
print(ans)
n,m = map(int,input().split())
pritn(n+m-1)

### FIXED CODE ###

n,m = map(int,input().split())
print((n-1)*(m-1))