Harryxun/stf_run huggingface dataset:
input()
if len(S)%2 == 0:
  for i in range(len(S)//2):
    if S[i*2:(i+1)*2]!="hi":
      print("No")
      exit()
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = "hi"
S = input()
flag = False
for i in range(5):
  if S==s:
    flag=True
    break
  s = s+"hi"
if flag:
  print("Yes")
else:
  print("No")
from collections import Counter
from collections import defaultdict
import math

def combination(n, r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

N = int(input())
L = defaultdict(int)
ans = 0
for _ in range(N):
    s = sorted(list(input()))
    L[s] += 1

for c in L.items():
    ans += combination(c, 2)
print(ans)

### FIXED CODE ###

from collections import Counter
from collections import defaultdict
import math

def combination(n, r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

N = int(input())
L = defaultdict(int)
ans = 0
for _ in range(N):
    s = sorted(list(input()))
    L[str(s)] += 1

for c in L.values():
    if c > 1:
        ans += combination(c, 2)
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n, m = map(int, input().split())
    penalty = dict()
    penalty_cnt = 0
    ans = set()
    for _ in range(m):
        num, result = input().split()
        if result == 'AC':
            ans.add(num)
            if num not in penalty:
                penalty[num] = 0
        elif num not in ans:
            if num not in penalty:
                penalty[num] = 1
            else:
                penalty[num] += 1
    ans = list(ans)
    for i in range(len(ans)):
        penalty_cnt += penalty[ans[i]]
    print(len(ans), penalty_cnt)

if __name__ == '__main__':
    main()
import bisect
s = input()
t = input()
N = len(s)

next_map = sorted(zip(s*2,range(N*2)))
br = bisect.bisect_right
ans = 0
i = 0
for c in t:
    map_idx = br(next_map,(c,i))
    if map_idx == N*2:
        ans = -2
        break
    a,j = next_map[map_idx]
    if a != c :
        ans = -2/0
        break
    ans += j - i
    i = j%N
ans += 1
print(ans)

### FIXED CODE ###

import bisect
s = input()
t = input()
N = len(s)

next_map = sorted(zip(s*2,range(N*2)))
br = bisect.bisect_right
ans = 0
i = -1
for c in t:
    map_idx = br(next_map,(c,i))
    if map_idx == N*2:
        ans = -1
        break
    a,j = next_map[map_idx]
    if a != c :
        ans = -1
        break
    ans += j - i
    i = j%N
print(ans)
import sys
import math
for a in sys.stdin:
        a =map(int,raw_input().split())
        b = a[0] + a[1]
        print int(math.log10(b)+1)

### FIXED CODE ###

import math
while True:
        try:
                a =map(int,raw_input().split())
                b = a[0] + a[1]
                print len(str(a[0]+a[1]))
        except EOFError:
                break
N , M = map(int , input().split())
A = []
B = []
flg=True

for i in range(N):
    A.append([j for j in input()])
for i in range(M):
    B.append([j for j in input()])

for i in range((N-M-1)*(N-M-1)):
    for j in range(M):
        for l in range(M):
            if B[j][l] != A[j+i][l+i]:
                flg = False
                break
 
if flg:
    print("Yes")
else:
    print("No") 

### FIXED CODE ###

N , M = map(int , input().split())
A = []
B = []
flg = False

for i in range(N):
    A.append([j for j in input()])
for i in range(M):
    B.append([j for j in input()])

for i in range(N-M+1):
    for k in range(N-M+1):
        if flg:
            break
        flg = True
        for j in range(M):
            for l in range(M):
                if B[j][l] != A[j+i][l+k]:
                    flg = False
                    
            
 
if flg:
    print("Yes")
else:
    print("No")
N = int(input())
S = input()

ans = 0

# 3文字以上
for i in range(0, N - 5):
    for j in range(i + 3, N):
        if S[i:i + 3] == S[j:j + 3]:
            i += 2
            j += 2
            max_length = j
            length = 3
            while True:
                if i + 1 == max_length or j + 1 == N:
                    break
                else:
                    i += 1
                    j += 1
                if S[i] == S[j]:
                    length += 1
                else:
                    break
            if length > ans:
                ans = length

# 2文字
if ans == 0:
    for i in range(0, N - 1):
        s = S[i:i + 2]
        if s in S[i + 2:]:
            ans = 2

# 1文字
if ans == 0:
    for i in range(N):
        s = S[i]
        if s in S[i + 1:]:
            ans = 1

print(ans)


### FIXED CODE ###

N = int(input())
S = input()

ans = 0
left, right = 0, 1
while right < N:
    s = S[left:right]
    if s in S[right:]:
        ans = max(ans, len(s))
        right += 1
    else:
        left += 1

print(ans)
A,B,K=list(map(int,input().split()))

if A==0 and B==0:
  pass
elif A>0:
  if A>=K:
  	A = A-K
  elif A+B>K:
    B = B-K+A
    A = 0
  else:
    A=0
    B=0
elif B>K:
  B=B-K
else:
  B=0
print('%d %d' % (A,B))

### FIXED CODE ###

S,T=input().split(' ')
print(T+S)
from sys import stdin
S = stdin.readline().rstrip()
n = len(S)
def dfs(i, f):
    if i = n-1:
        return sum(list(map(int, f.split('+'))))
    return dfs(i+1, f + S[i + 1]) + dfs(i + 1, f + '+' s[i-1])
#最初が＋なし、次が＋あり
print(def(0, S[0]))


### FIXED CODE ###

from sys import stdin
S = stdin.readline().rstrip()
n = len(S)
def dfs(i, f):
    if i == n-1:
        return sum(list(map(int, f.split('+'))))
    return dfs(i+1, f + S[i + 1]) + dfs(i + 1, f + '+' + S[i+1])
print(dfs(0, S[0]))
M,N=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()

if M > N:
	if N == 1:
		print(sum(xdelta))
	else:
		for i in range(M-1):
			xdelta.pop(-1)
		print(sum(xdelta))
else:
	print(0)

### FIXED CODE ###

N,M=map(int,input().split())
X = list(map(int,input().split()))
X.sort()
xdelta = []

for i in range(len(X)-1):
	xdelta.append(abs(X[i+1]-X[i]))

xdelta.sort()

if N < M:
	if N == 1:
		print(sum(xdelta))
	else:
		for i in range(N-1):
			xdelta.pop(-1)
		print(sum(xdelta))
else:
	print(0)
N = int(input())
edge = [[] for i in range(N)]
count = [0] * N
color = {}
egs = []
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    count[a] += 1
    count[b] += 1
    edge[a].append(b)
    edge[b].append(a)
    egs.append(tuple(sorted([a, b])))


ans = max(count)
c = 1



def dfs(idx, pr):
    c = 1
    col = color[pr]
    for i in edge[idx]:
        if i not in pr:
            if c == col:
                c+=1
            x, y = sorted([i, idx])
            color[(x, y)] = c
            dfs(i, (x, y))
        c+=1

color[(-1, -1)] = 0
dfs(0, (-1, -1))
print(ans)
for tpl in egs:
    print(color[tpl])




### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N = int(input())
edge = [[] for i in range(N)]
count = [0] * N
color = {}
egs = []
for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    count[a] += 1
    count[b] += 1
    edge[a].append(b)
    edge[b].append(a)
    egs.append(tuple(sorted([a, b])))


ans = max(count)
c = 1



def dfs(idx, pr):
    c = 1
    col = color[pr]
    for i in edge[idx]:
        if i in pr:
            continue
        if c == col:
            c+=1
        x, y = sorted([i, idx])
        color[(x, y)] = c
        dfs(i, (x, y))
        c+=1

color[(-1, -1)] = 0
dfs(0, (-1, -1))
print(ans)
for tpl in egs:
    print(color[tpl])
def mergesort(A, left, right):

    if left + 1 < right:
        mid = (left + right)/2
        
        mergesort(A, left, mid)
        mergesort(A, mid, right)
        merge(A, left, mid, right)


def merge(A, left, mid, right):
   
    n1 = mid -left
    n2 = right - mid
    L = []
    R = []
    x = [" "," ", 100000000000000000000000000000000]
    for i in range(0, n1):
        L.append(A[left + i])
    for i in range(0, n2):
        R.append(A[mid + i])
    L.append(x)
    R.append(x)
    i = 0
    j = 0
    for k in range(left, right):
        if int(L[i][-1]) <= int(R[j][-1]):
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
        



# kannsei
def partition(A, p, r):
    x = int(A[r-1][2])
    i = p - 1
    for j in range(p, r-1):
        if int(A[j][2]) <= x:
            i = i + 1
            A[i],A[j]=A[j], A[i]
            
    A[i+1], A[r-1]=A[r-1], A[i+1]
    
    retu
rn i+1

def quicksort(A, p, r):
    if p < r-1:
        q = partition(A, p, r)
        
        quicksort(A, p, q)
        quicksort(A, q+1, r)


if __name__ == "__main__":
    num = int(raw_input())
    num_list = []
    num_list1 = []
    for i in range(num):
        num_list.append(raw_input())
    num_list1 = list(num_list)
    quicksort(num_list, 0, len(num_list))
    print " \n".join(num_list)
    mergesort(num_list1, 0, len(num_list1))
    print "\n".join(num_list1)
    
    if num_list == num_list1:
        print ("Stable")
    else:c
        print ("NOt stable")

### FIXED CODE ###

def mergesort(A, left, right):
 
    if left + 1 < right:
        mid = (left + right)/2
         
        mergesort(A, left, mid)
        mergesort(A, mid, right)
        merge(A, left, mid, right)
 
 
def merge(A, left, mid, right):

    n1 = mid -left
    n2 = right - mid
    L = []
    R = []
    x = "  10000000000"
    for i in range(0, n1):
        L.append(A[left + i])
    for i in range(0, n2):
        R.append(A[mid + i])
    L.append(x)
    R.append(x)
    i = 0
    j = 0
    for k in range(left, right):
        if int(L[i][2:]) <= int(R[j][2:]):
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
            
            
def partition(A, p, r):
    x = int(A[r-1][2:])
    i = p - 1
    for j in range(p, r-1):
        if int(A[j][2:]) <= x:
            i = i + 1
            A[i],A[j]=A[j], A[i]
             
    A[i+1], A[r-1]=A[r-1], A[i+1]
    return i+1
 
def quicksort(A, p, r):
    if p < r-1:
        q = partition(A, p, r)
         
        quicksort(A, p, q)
        quicksort(A, q+1, r)
 
 
 
 
if __name__ == "__main__":
    num = int(raw_input())
    num_list = []
    num_list1 = []
    for i in range(num):
        num_list.append(raw_input())
    num_list1 = list(num_list)
    quicksort(num_list, 0, len(num_list))
  
    mergesort(num_list1, 0, len(num_list1))
     
    if num_list == num_list1:
        print ("Stable")
    else:
        print ("Not stable")
    print "\n".join(num_list)
N,A,B=map(int,input().split())

import numpy as np
blue=np.array([1]*A)
red=np.array([-1]*B)
ball=np.array(list(np.concatenate([blue,red]))*N)
ball=list(ball[0:N])
print(ball.count(1))

### FIXED CODE ###

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

r=N//(A+B)*A
s=N%(A+B)

x=r+min(A,s)
print(x)
n,s,k = map(str, input().split('\n'))
n = int(n)
k = int(k)
char = s[k-1]
ans=''
for i in s:
    if i!=char:
        ans+='*'
    else:
        ans+=char
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
k = int(input())

char = s[k-1]
ans=''
for i in s:
    if i!=char:
        ans+='*'
    else:
        ans+=char
print(ans)
N, Q = map(int, input().split())
AB = [[0]*2 for i in range(N-1)]
for i in range(N-1):
  AB[i] = list(map(int, input().split()))
C = [0]*N
g = list([] for i in range(N+1))
for i in range(Q):
  p, x = map(int, input().split())
  C[p-1] += x

for i,j in AB:
  g[i].append(j)
  g[j].append(i)
 
def BTS(a, b):
  for i in g[a]:
    if i == b:
      continue
    C[i-1] += C[a-1]
    BTS(i,i)
    
BTS(1,-1)
 
print(*C)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)

N, Q = map(int, input().split())
AB = [[0]*2 for i in range(N-1)]
for i in range(N-1):
  AB[i] = list(map(int, input().split()))
C = [0]*N
g = list([] for i in range(N+1))
for i in range(Q):
  p, x = map(int, input().split())
  C[p-1] += x

for i,j in AB:
  g[i].append(j)
  g[j].append(i)
 
def BTS(a, b):
  for i in g[a]:
    if i == b:
      continue
    C[i-1] += C[a-1]
    BTS(i,a)
    
BTS(1,-1)
 
print(*C)
function check(n):
    i = 1
    print(" ",end="")
    while(i != n):
        if  (i % 3 == 0):
            print(i,end="")
        elif(i % 10 == 3):
            print(i,end="")
            i = i / 10
        


### FIXED CODE ###

n = int(input())

for  i in range(1,n+1):
    if i%3 == 0 or str(i).find("3") != -1:
        print(" %d" %i ,end="")
print()
from itertools import permutations
N,M,R = map(int,input().split())
RList = list(map(int,input().split()))
dp = [[[float("INF")]*(N+1) for _ in range(N+1)]for _ in range(N+1)]
for i in range(N+1):
    dp[i][i] = 0
for _ in range(M):
    a,b,c = map(int,input().split())
    dp[a][b] = c
    dp[b][a] = c

for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            dp[j][k] = min(dp[j][i]+dp[i][k],dp[j][k])

ans = float("INF")
RList = list(permutations(RList))
for Rs in RList:
    tmp = 0
    for i in range(1,R):
        a = Rs[i-1]
        b = Rs[i]
        tmp += dp[a][b]
    ans = min(ans,tmp)
print(ans)

### FIXED CODE ###

N,M,r = map(int,input().split())
R = list(map(int,input().split()))
#dp[i][j][k] -> 町iまで経由地点として使える。j,kの最短移動距離
dp = [[float("INF")]*(N+1) for _ in range(N+1)]
for _ in range(M):
    a,b,c = map(int,input().split())
    dp[a][b] = c
    dp[b][a] = c

for i in range(N+1):
    dp[i][i] = 0

for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(N+1):
            dp[j][k] = min(dp[j][k],dp[j][i]+dp[i][k])

from itertools import permutations
ans = float("INF")
for pattern in permutations(R):
    cost = 0
    for i in range(r-1):
        cost += dp[pattern[i]][pattern[i+1]]
    ans = min(ans,cost)
print(ans)
a=int(input());print("ABC"if a<1200"ARC"elif a<2800else"AGC")

### FIXED CODE ###

a=int(input())
if a<1200:
  print("ABC")
elif a<2800:
  print("ARC")
else:
  print("AGC")
import math
N=int(input())
for i in reversed(range(int(math.sqrt(N)))):
    if N % i == 0:
        a=i
        break
print(int(a+int(N/a)-2))

### FIXED CODE ###

N=int(input())
for i in reversed(range(int(N**0.5)+1)):
    if N % i == 0:
        print(int(i+N//i-2))
        break
class unionFind:
    def __init__(self, n, p):
        self.data = [-1] * n

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

    def unite(self, x, y):
        a, b = self.find(x), self.find(y)
        if a!=b:
            self.data[b] += self.data[a]
            self.data[a] = b


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

tree = unionFind(n, p)
for i in range(m):
    x, y = map(int, input().split())
    tree.unite(p[x-1]-1, p[y-1]-1)

ans = 0
for i in range(n):
    if tree.find(i)==tree.find(p[i]-1): ans += 1
print(ans)

### FIXED CODE ###

class unionFind:
    def __init__(self, n):
        self.data = [-1] * (n+10)

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

    def unite(self, x, y):
        a, b = self.find(x), self.find(y)
        if a!=b:
            self.data[b] += self.data[a]
            self.data[a] = b


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

tree = unionFind(n)
for i in range(m):
    x, y = map(int, input().split())
    tree.unite(p[x-1], p[y-1])

ans = 0
for i in range(n):
    if tree.find(i+1)==tree.find(p[i]): ans += 1
print(ans)
r,g,b = map(int,input()split())

if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

r,g,b = map(int,input().split())

if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")
a,b,c = input(),input(),input()

if (int(a) + int(b) >= int(c)):
    print ('Yes')
else:
    print ('No')

### FIXED CODE ###

a,b,c = input().split()

if (int(a) + int(b) >= int(c)):
    print ('Yes')
else:
    print ('No')
W,H,N = map(int,input().split())
zero = [0,0]
X = [W,H]
ans = True
for i in range(N):
    x,y,a = map(int,input().split())
    if(a == 1):
        if zero[0] < x < X[0]:
            zero[0] = x
        elif X[0] =< x:
            ans = False
            break
    elif(a == 2):
        if zero[0] < x < X[0]:
            X[0] = x
        elif zero[0] => x:
            ans = False
            break
    elif(a == 3):
        if zero[1] < y < X[1]:
            zero[1] = y
        elif X[1] =< y:
            ans = False
            break
    elif(a == 4):
        if zero[1] < y < X[1]:
            X[1] = y
        elif zero[0] => y:
            ans = False
            break
if(ans):
    S = (X[1] - zero[1]) * (X[0] - zero[0])
    print(S)
else:
    print(0)

### FIXED CODE ###

W,H,N = map(int,input().split())
zero = [0,0]
X = [W,H]
ans = True
for i in range(N):
    x,y,a = map(int,input().split())
    if(a == 1):
        if zero[0] < x < X[0]:
            zero[0] = x
        elif X[0] <= x:
            ans = False
            break
    elif(a == 2):
        if zero[0] < x < X[0]:
            X[0] = x
        elif zero[0] >= x:
            ans = False
            break
    elif(a == 3):
        if zero[1] < y < X[1]:
            zero[1] = y
        elif X[1] <= y:
            ans = False
            break
    elif(a == 4):
        if zero[1] < y < X[1]:
            X[1] = y
        elif zero[1] >= y:
            ans = False
            break
if(ans):
    S = (X[1] - zero[1]) * (X[0] - zero[0])
    print(S)
else:
    print(0)
while(True):

    x1,y1,x2,y2,x3,y3,xp,yp=[float(p) for p in input().split()]

    x_vector_1to2=x2-x1;
    y_vector_1to2=y2-y1;
    x_vector_1to3=x3-x1;
    y_vector_1to3=y3-y1;
    x_vector_p=xp-x1;
    y_vector_p=yp-y1;

    def renritu(p,q,r,s,t,u):  # renritu(p,q,r,s,t,u) px + qy = r  sx+ty=u
        a=p; b=q; c=r; d=s; e=t; f=u;
        a1=a*d; b1=b*d; c1=c*d; d1=d*a; e1=e*a; f1=f*a;
        res_y=b1-e1;
        if res_y != 0 :
            res_y =(c1-f1)/res_y;
            res_x =(c-b*res_y)/a;
            return(res_x,res_y)
        else:
            return(-1,-1)

    res=renritu(x_vector_1to2,x_vector_1to3,x_vector_p,y_vector_1to2,y_vector_1to3,y_vector_p)
    if res[0] >=0 and res[1] >=0 and (res[0]+res[1])<=1:
        print('YES')
    else:
        print('NO')



### FIXED CODE ###

def cross(x, y):
    return (x.conjugate() * y).imag
 
def inside_triangle(p, x, y, z):
    a = cross(y-x, p-y)
    b = cross(z-y, p-z)
    c = cross(x-z, p-x)
    if a*b > 0 and b*c > 0:
        return True
    return False
 
import sys
 
for line in sys.stdin:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split())
    x = complex(x1, y1)
    y = complex(x2, y2)
    z = complex(x3, y3)
    p = complex(xp, yp)
    if inside_triangle(p, x, y, z):
        print('YES')
    else:
        print('NO')
import math
n , x = map(int,input().split())
p = list(map(int,input().split()))
ans = abs(x - p[0])
for i in range(n):
    ans = math.gcd(ans,abs( x - p[i] ))
    
print(ans)

### FIXED CODE ###

import fractions
n , x = map(int,input().split())
p = list(map(int,input().split()))
ans = abs(x - p[0])
for i in range(n):
    ans = fractions.gcd(ans,abs( x - p[i] ))
    
print(ans)
n = int(input())
x = []
for i in range(n):
    X,L = map(int, input().split())
    x.append([X-L,X+L])
x.sort()
y = [0]*n
ans = 0
for i in range(n-2):
    if x[i][1]>x[i+2][0]:
        ans +=1
        y[i] = -1
    elif x[i][1]>x[i+1][0] and y[i]==0:
        y[i] +=1
        y[i+1] +=1
    elif x[i][1]>x[i+1][0] and y[i]==1:
        ans +=1
        y[i] = -1
        y[i-1] = 0
        continue
if x[-1][0]<x[n-3][1]:
    y[-1] = -1
    ans +=1
elif x[-1][0]<x[n-2][1]:
    y[-1] +=1
    y[n-2] +=1

for i in range(n-1):
    if y[i]<=0:
        continue
    else:
        y[i] = 0
        y[i+1] = 0
        ans +=1
print(n-ans)

 

### FIXED CODE ###

n = int(input())
x = []
for i in range(n):
    X,L = map(int, input().split())
    x.append([X-L,X+L])
x.sort(key=lambda x:x[0])
ans = n
tmp = x[0][1]
for i in range(1,n):
    if tmp>x[i][0]:
        ans -=1
        tmp = min(tmp,x[i][1])
    else:
        tmp = x[i][1]
print(ans)
X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(f"{X} {Y} {Z}")

### FIXED CODE ###

X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(str(X)+" "+str(Y)+" "+str(Z))
#import math
S=input()
#int(input())
#map(int,input().split())
#list(map(int,input().split()))
#[input() for _ in range()]

if S[1] == B:
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

#import math
S=input()
#int(input())
#map(int,input().split())
#list(map(int,input().split()))
#[input() for _ in range()]

if S[1] == 'B':
    print('ARC')
else:
    print('ABC')
import math
if __name__ == '__main__':
  
  S = input()
  index = range(0, len(S)-2)
  comp_num = 753
  min = 0
  tempmin = math.inf
  for i in index:
    temp = int (S[i]+S[i+1]+S[i+2])
    min = abs(comp_num - temp)
    if (min >= tempmin):
      break
    tempmin = min


  print(min)

### FIXED CODE ###


if __name__ == '__main__':
  
  S = input()
  comp_num = 753
  min = 10000000000000000
  for i in range(0, len(S)-2):
    temp = int (S[i]+S[i+1]+S[i+2])
    tempmin = abs(comp_num - temp)
    
    if tempmin <= min:
      min = tempmin
  print(min)
ab = [int(i)for i in input().split()]¥
print(max(ab[0] + ab[1],max(ab[0] * ab[1], ab[0]-ab[1])))

### FIXED CODE ###

ab = [int(i)for i in input().split()]
print(max(ab[0] + ab[1],max(ab[0] * ab[1], ab[0]-ab[1])))
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter

stdin = open("sample.txt")

a = int(stdin.readline().rstrip())

b = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(b[a-1])

### FIXED CODE ###

from sys import stdin
# stdin = open("sample.txt")

a = int(stdin.readline().rstrip())

b = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(b[a-1])
import sys
import math
input=sys.stdin.readline
n,q=map(int,input().split())
for i in range(q):
    u,v=map(int,input().split())
    u-=1
    v-=1
    while u!=v:
        if u>v:
            u=(u-1)//(n**(max(1,math.floor(math.log(n,u/(1.0*v))-1))))
        else:
            v=(v-1)//(n**(max(1,math.floor(math.log(n,v/(1.0*v))-1))))
    print(u+1)


### FIXED CODE ###

import sys
input=sys.stdin.readline
n,q=map(int,input().split())
for i in range(q):
    u,v=map(int,input().split())
    if n==1:
        print(min(u,v))
        continue
    u-=1
    v-=1
    while u!=v:
        if u>v:
            if (u-1)//n>v:
                u=(((u-1)//n)-1)//n
            else:
                u=(u-1)//n
        else:
            if (v-1)//n>v:
                v=(((v-1)//n)-1)//n
            else:
                v=(v-1)//n
    print(u+1)
print(len([i for i in range(i,int(input())+1) if len(str(i))%2]))

### FIXED CODE ###

n=int(input())
if n==100000:
    print(90909)
elif n<100:
    print(min(9,n))
elif n<1000:
    print(9+(n-99))
elif n<10000:
    print(909)
else:
    print(909+(n-9999))
#標準入力
N = int(input())
A = list(map(int, input().split()))
 
#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]
  
_sum = 0
for i in range(N-1):
  _sum = _sum + (A[i] * (S[N] - S[i+1]))
  _sum = _sum % (1000000000+7)
  
print(_sum)

### FIXED CODE ###

#標準入力
N = int(input())
A = list(map(int, input().split()))

#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]

_sum = int(0)
for i in range(N-1):
  _sum = _sum + (A[i] * (S[-1] - S[i]))

#modulo
_sum = _sum % (1000000000+7)
  
print(_sum)