Harryxun/stf_run huggingface dataset:
s = str(input())
l = len(list(s))

if l<=3:
    print(0)
else:
    n = 0
    for i in range(4,l+1):
        for j in range(0,l-i+1):
            if int(s[j:j+i])%2019 == 0:
                n += 1
            else:
                n += 0

print(n)

### FIXED CODE ###

s = input()[::-1]

dp = [0]*2019
dp[0]=1
total = 0
a = 1

for i in list(s):
  total += int(i)*a
  total %= 2019
  dp[total] += 1
  a *= 10
  a %= 2019
count=0
  
for i in range(2019):
    count += dp[i]*(dp[i]-1)//2
 
print(count)
n = int(input())
print(4 if n >= 189 else 3 if n >= 165 else if 2 if n >= 135 else 1 if n >= 105 else 0)

### FIXED CODE ###

print((lambda x:(x[0]-1)*(x[1]-1))(list(map(int,input().split()))))
import sys
for line in sys.stdin:
    p = line.index(' ')
    a,b = line[:p],line[p+1:]
    a,b = int(a),int(b)
    print '%d %d %.12f' %(a/b, a%b, 1.0*a/b)

### FIXED CODE ###

a, b = map(int, raw_input().split())
print '%d %d %.12f' %(a/b, a%b, 1.0*a/b)
import itertools
n = int(input())
name = [0]*n
s = []
for i in range(n):
    st = input()
    if st[0] == 'M':
        name[0] += 1
    elif st[0] == 'A':
        name[1] += 1
    elif st[0] == 'R':
        name[2] += 1
    elif st[0] == 'C':
        name[3] += 1
    elif st[0] == 'H':
        name[4] += 1
    s.append(st)

ans = 0
for v in itertools.combinations(name, 3):
    # print(v)
    ans += v[0]*v[1]*v[2]

print(ans)

### FIXED CODE ###

import itertools
N = int(input())
S_num = [0] * 5
answer = 0
for _ in range(N):
    S = input()
    if S[0] == 'M':
        S_num[0] += 1
    elif S[0] == 'A':
        S_num[1] += 1
    elif S[0] == 'R':
        S_num[2] += 1
    elif S[0] == 'C':
        S_num[3] += 1
    elif S[0] == 'H':
        S_num[4] += 1

for v in itertools.combinations(S_num, 3):
    answer += v[0] * v[1] * v[2]
print(answer)
s=input().strip()
K=int(input())
st=set()
for i in range(len(s)-1):
    for k in range(i+1,min(len(s),i+K+1)):
        st.add(s[i:k])
print(sorted(st)[K-1])

### FIXED CODE ###

s=input().strip()
K=int(input())
sorteds=sorted(set(s))
ct=0
subsset=set()
for c in sorteds:
    ct+=1
    ixs=[]
    ss=s
    ix=0
    while len(ss):
        ii=ss.find(c)
        if ii==-1:break
        ixs.append(ix+ii)
        ix=ix+ii
        ss=ss[ii:]
        for i in range(min(len(ss),K)):
            subsset.add(ss[:1+i])
        ss=ss[1:]
    if len(subsset)>=K:
        break
print(sorted(list(subsset))[K-1])
n = int(input())
a = list(map(int, input().split()))

ans = 1
b = [0] * ((n + 1) // 2)

if n % 2 == 0:
    for x in a:
        if x % 2 == 0:
            print(0)
            exit()
        b[x // 2] += 1
    for y in b:
        if y != 2:
            print(0)
            exit()
else:
    for x in a:
        if x % 2 != 0:
            print(0)
            exit()
        b[x // 2] += 1
    for y in b[1:]:
        if y != 2:
            print(0)
            exit()
        if b[0] != 1:
            print(0)
            exit()

print((2 ** (n//2)%(10**9+7))


### FIXED CODE ###

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

b = [0] * ((n + 1) // 2)

if n % 2 == 0:
    for x in a:
        if x % 2 == 0:
            print(0)
            exit()
        b[x // 2] += 1
    for y in b:
        if y != 2:
            print(0)
            exit()
else:
    for x in a:
        if x % 2 != 0:
            print(0)
            exit()
        b[x // 2] += 1
    for y in b[1:]:
        if y != 2:
            print(0)
            exit()
        if b[0] != 1:
            print(0)
            exit()

print((2 ** (n//2)%(10**9+7)))
def d(p, q):
    return pos[p] - pos[q]

def solve():
    p0, p1, p2 = 0, 0, 0
    best = 0
    fail = False
    while p0 < N:
        if fail:
            p0 += 1
            # p2????±???????
            while d(p2, p1) > d(p1, p0) and p2 > p1:
                p2 -= 1
            fail = False
        # p1????±???????
        if p1 <= p0: p1 = p0 + 1
        while d(p1, p0) <= best and p1 - p0 < N:
            p1 += 1
        if d(p1, p0) <= best:
            fail = True
            continue
        # p2????±???????
        if p2 <= p1: p2 = p1 + 1
        while d(p2,p1) < d(p1, p0) and p2 - p0 < N:
            p2 += 1
        if d(p2, p1) < d(p1, p0):
            fail = True
            continue
        # check
        if L - d(p2, p0) >= d(p1, p0):
            best = d(p1, p0)
            if best >= L//3:
                return best
        else:
            fail = True
    return best

N = int(input())
A = [0] * N
L = 0
for i in range(N):
    A[i] = int(input())
    L += A[i]
pos = [0] * (2*N)
for i in range(1, 2*N):
    pos[i] = pos[i-1] + A[(i-1)%N]

print(solve())

### FIXED CODE ###

def solve():
    p0, p1, p2 = 0, 1, 2
    best = 1
    succ = True
    while p0 < N-1:
        if not succ:
            p0 += 1
            while d[p2]- d[p1] > d[p1]- d[p0]:
                p2 -= 1

        succ = False

        while p1 - p0 < N - 1 and d[p1] - d[p0] <= best:
            p1 += 1
        d0 = d[p1] - d[p0]
        if d0 <= best:
            continue

        while p2 - p0 < N and d[p2] - d[p1] < d0:
            p2 += 1
        if d[p2] - d[p1] < d0:
            continue

        if L - (d[p2] - d[p0]) >= d0:
            best = d0
            if best >= L//3:
                return best
            succ = True

    return best

N = int(input())
A = [int(input()) for i in range(N)]
L = sum(A)
d = [0] * (2 * N)
for i in range(1, 2 * N):
    d[i] = d[i-1] + A[(i-1)%N]

print(solve())
import math
N = int(input())

nlist=[""]*N

for i in range(N):
    t=str(input())
    t = ''.join(sorted(t))
    nlist[i] = t

cnt=1
sum=0
tsum=1
nlist=sorted(nlist)
tmpStr=nlist[0]
for i in range(1,N):
    if(tmpStr==nlist[i]):
        tsum+=1
    else:
        tmpStr=nlist[i]
        sum+=math.factorial(tsum)/2
        tsum=1
if(tsum!=1):
        tmpStr=nlist[i]
        sum+=math.factorial(tsum)/2
        

print(int(sum))


### FIXED CODE ###

import math
N = int(input())

nlist=[""]*N
d={}
for i in range(N):
    t=str(input())
    t=''.join(sorted(t))
    if d.get(t,None)==None:
        d[t]=1
    else:
        d[t]+=1 
ans=0

#print(d.keys(),d.values())
for i in d.values():
    ans += i*(i-1)/2
print(int(ans))
N = int(input())
MOD = 10**9+7
P2 = [1]
for i in range(N):
  P2 += [(P2[-1]*2)%MOD]
pre = [-1]*(N+1)
p = -1
end = 0
ans = 1
for i in range(N):
  c = int(input())
  if pre[c]!=-1:
    if p==c:
      continue
    ans += P2[pre[c]]
    end += 1
    pre[c] = end
  else:
    pre[c] = end
  p = c
print(ans%MOD)

### FIXED CODE ###

from collections import defaultdict
N = int(input())
MOD = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
dic = defaultdict(int)
p = -1
for i in range(N):
  c = int(input())
  if c==p:
    dp[i+1] = dp[i]
    continue
  dic[c] += dp[i]
  dp[i+1] = dic[c]%MOD
  p = c
#  print(dp)

print(dp[-1]%MOD)
l,r=map(int,input().split())
d=int(input())

print(r//d - l//d)

### FIXED CODE ###

l,r,d = map(int,input().split())

if l%d ==0:
  print(r//d - l//d +1)
else:
  print(r//d-l//d)
n = int(raw_input())

d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
g = [0 for i in range(n)]
temp_d = [0]

def BFS_visit(s, temp_d):
    if temp_d == 99999:
        temp_d = 0
    if d[s] > temp_d:
        d[s] = temp_d
    temp_d += 1
    for e in range(n):
        if M[s][e] == 1:
            BFS_visit(e, temp_d)

def BFS():
    for s in range(n):
        BFS_visit(s, d[s])
    for s in range(n):
        if d[s] == 99999:
            d[s] = -1
    for s in range(n):
        print'{0} {1}'.format(s+1, d[s])

for i in range(n):
    G = map(int, raw_input().split())
    for j in range(G[1]):
        M[G[0]-1][G[2+j]-1] = 1
    g[i] = G[1]
BFS()

### FIXED CODE ###

n = int(raw_input())
 
d = [99999 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
 
def BFS(s):
    for e in range(n):
        if M[s][e] == 1:
            if d[e] > d[s] + 1:
                d[e] = d[s]+1
                BFS(e)
 
for i in range(n):
    G = map(int, raw_input().split())
    for j in range(G[1]):
        M[G[0]-1][G[2+j]-1] = 1
 
d[0] = 0
for s in range(n):
        BFS(s)
for s in range(n):
    if d[s] == 99999:
        d[s] = -1
for s in range(n):
    print'{0} {1}'.format(s+1, d[s])
from scipy.special import comb
a = list(map(int,input().split()))

print(comb(a[0], 2, exact=True) + comb(a[1], 2, exact=True))

### FIXED CODE ###

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

s = [i for i in range(a[0])]
t = [i for i in range(a[1])]

n = list(itertools.combinations(s, 2))
m = list(itertools.combinations(t, 2))

print(len(n) + len(m))
s = int(input())
w = int(input())
if ( w >= s )
	print("unsafe")
else
	print("safe")

### FIXED CODE ###

s, w = map(int, input().split())
if ( w >= s ):
    print("unsafe")
else:
    print("safe")
K = int(input())
A,B = map(int,input().split())

a = (B//K) - (A//K)

if A==B:
    if A % K = 0:
        print("OK")

    else:
        print("NG")

if a==0:
    print("NG")

else:
    print("OK")

### FIXED CODE ###

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

a = (B//K)*K - A

if a < 0:
    print("NG")

else:
    print("OK")
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
num=min(n,k)
a=max(n,k)%min(n,k)
b=min(n,k)
for i in range(10):
    b=abs(b-a)
    num=min(b,num)
print(num if min(n,k)!=1 else 0)


### FIXED CODE ###

import sys
input=sys.stdin.readline
n,k=map(int,input().split())
ans1=min(n%k,k-n%k)
print(ans1)
n,m=map(int,input().split())
val=4*m
c=0
for i in range(n):
  v=int(input())
  v=v/val
  if(v<m):
    c=c+0
  else:
    c=c+1
if(c>=m):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

n,m = input().split()
N = int(n)
M = int(m)
a = [int(i) for i in input().split()]
a.sort(reverse=True)
k = sum(a)/(4*M)
if k > a[M-1]:
    print('No')
else:
    print('Yes')
# -*- coding: utf-8 -*-

def main():
    input_num = int(input())
    flag = True
    sum_num = 0

    while flag:
        chushutsu = input_num % 10
        sum_num += chushutsu
        input_num = (input_num - chushutsu) / 10
        if input_num == 0:
            flag = False

    if sum_num % 9 == 0:
        print('Yes')

    else:
        print('No')

if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

def main():
    input_num = input()
    sum_num = 0

    for i in range(len(input_num)):
        chushutsu = int(input_num[i])
        sum_num += chushutsu
    
    if sum_num % 9 == 0:
        print('Yes')

    else:
        print('No')

if __name__ == '__main__':
    main()
import sys
S0=raw_input()
T=list(raw_input())

l=len(T)


ans=""
for i in range(len(S0)-l+1):
	S1=list(S0)
	for j in range(l):
		#print i+j,j,S1[i+j],T[j]
		if S1[i+j]!=T[j] and S1[i+j]!="?":
			#print "break"
			break
	else:
		#print "else"
		for j in range(l):
			S1[i+j]=T[j]
		S_tmp=(''.join(S1)).replace('?','a')
		#print ans
		#print S_tmp
		if ans=="":
			ans=S_tmp
		if S_tmp < ans:
			ans=S_tmp
			
	
if S0==''.join(S1) and S0.find("?")!=-1:
	print "UNRESTORABLE"
	sys.exit()
	

print ans



### FIXED CODE ###

import sys
S0=raw_input()
T=list(raw_input())

l=len(T)

if len(S0)<len(T):
	print "UNRESTORABLE"
	sys.exit()


ans=""
for i in range(len(S0)-l+1):
	S1=list(S0)
	#print S1
	for j in range(l):
		#print i+j,j,S1[i+j],T[j]
		if S1[i+j]!=T[j] and S1[i+j]!="?":
			#print "break"
			break
	else:
		#print "else"
		for j in range(l):
			S1[i+j]=T[j]
		S_tmp=(''.join(S1)).replace('?','a')
		#print ans
		#print S_tmp
		if ans=="":
			ans=S_tmp
		if S_tmp < ans:
			ans=S_tmp
			
	
if ans=="":
	print "UNRESTORABLE"
	sys.exit()
else:
	print ans
a = input()
b = input()
c = input()
x = input()

cnt = 0
for i in range(a + 1):
	if 500 * i <= x:
		p = x - 500 * i
		for j in range(b + 1):
			if 100 * j <= p:
				q = p - 100 * j:
				for k in range(c + 1):
					if q - 50 * k == 0:
						cnt += 1

print(cnt)

### FIXED CODE ###

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

cnt = 0
for i in range(a + 1):
	for j in range(b + 1):
		for k in range(c + 1):
			if 500 * i + 100 * j + 50 * k == x:
				cnt += 1

print(cnt)
import sys
N,M=map(int,input().split())
dp=[1]*N
listA=[]
for i in range(M):
  a=int(input())
  listA+=[a]
  dp[a-1]=0
for i in range(1,M):
  if listA[i]==listA[i-1]:
    print(0)
    sys.exit()
setA=set(listA)    
if (1 not in setA) and (2 not in setA):
  dp[1]=2
for i in range(2,N):
  if i+1 not in setA:
    dp[i]=dp[i-1]+dp[i-2]
ans=dp[-1]%(10**9+7)
print(ans)

### FIXED CODE ###

import sys
N,M=map(int,input().split())
dp=[1]*N
listA=[]
for i in range(M):
  a=int(input())
  listA+=[a]
  dp[a-1]=0
for i in range(1,M):
  if listA[i]==listA[i-1]:
    print(0)
    sys.exit()
setA=set(listA)    
if (1 not in setA) and (2 not in setA) and N!=1:
  dp[1]=2
for i in range(2,N):
  if i+1 not in setA:
    dp[i]=dp[i-1]+dp[i-2]
ans=dp[-1]%(10**9+7)
print(ans)
s = int(input())
n = "1"
string_list = [input() for i in range(n)]
int_list = (int(s) for s in string_list)
m = max(int_list)
if sum(int_list) - int(m) > int(m)
else print("Yes")
elif print("NO")

### FIXED CODE ###

s = int(input())
A = list(map(int, input().split())) 
m = max(A)
if sum(A) - int(m) > int(m):
    print("Yes")
elif sum(A) - int(m) <= int(m):
    print("No")
s = list(set(input()))
t = "abcdefghijklmnopqrstuvwxyz"

ans = -1
for i in len(s):
	if s[i] != t[i]:
		ans = (s[i])
		break
print(ans) 


### FIXED CODE ###

s = sorted(list(set(input()))) + ["A"] *26
t = "abcdefghijklmnopqrstuvwxyz"

ans = "None"
for i in range(len(t)):
	if s[i] != t[i]:
		ans = (t[i])
		break
print(ans)
n = int(input())
a = [0 for _ in range(10000)]
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            b = i*i+j*j+k*k+i*j+j*k+k*i-1
            if b < 10000:
                a[b] += 1
for i in range(n):
    print(a[n])

### FIXED CODE ###

n = int(input())
a = [0]*n
s = int(n**(1/2))+1
for i in range(1, s):
    for j in range(1, s):
        for k in range(1, s):
            b = i*i+j*j+k*k+i*j+j*k+k*i-1
            if b < n:
                a[b] += 1
for i in range(n):
    print(a[i])
import sys

def check_ans(s,x):
  if len(s)==0 and x!=0:
    return False
  elif len(s)==0 and x==0:
    return True
  dp=[[False] * 8001] *(len(s)+1)
  dp[1][s[0]]=True
  for i in range(1,len(s)):
    for j in range(0,8002):
      if dp[i][j]:
        res=abs(j+s[i])
        res2=abs(j-s[i])
        dp[i+1][res]=True
        dp[i+1][res2]=True
  return dp[len(s)][x]

S = sys.stdin.readline().strip()
X,Y=map(int,input().split())
d=1
while S[0]=='F':
  S=S[1:]
  X-=1
nx=[]
ny=[]
X=abs(X)
Y=abs(Y)

while S:
  step=0
  while S and S[0]=='T':
    d*=-1
    S=S[1:]
  while S and S[0]=='F':
    step+=1
    S=S[1:]
  if d==1:
    nx.append(step)
  else:
    ny.append(step)

if check_ans(nx,X) and check_ans(ny,Y):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys

def check_ans(s,x):
  res=[0]
  for i in s:
    res = set([x + i for x in res]) | set([x - i for x in res])
  return x in res

S = sys.stdin.readline().strip()
X,Y=map(int,input().split())
d=1
while S and S[0]=='F':
  S=S[1:]
  X-=1
if len(S)==0:
  if X==0 and Y==0:
    print("Yes")
  else:
    print("No")
  sys.exit()

nx=[]
ny=[]
X=abs(X)
Y=abs(Y)

while S:
  step=0
  while S and S[0]=='T':
    d*=-1
    S=S[1:]
  while S and S[0]=='F':
    step+=1
    S=S[1:]
  if step==0:
    break
  if d==1:
    nx.append(step)
  else:
    ny.append(step)

if check_ans(nx,X) and check_ans(ny,Y):
  print("Yes")
else:
  print("No")
N = int(input())
T = list(map(int, input().split()))
M = int(input())
P, X = [], []
for _ in range(M):
    p, x = map(int, input().split())
    P.append(p)
    X.append(x)

t_sum = sum(T)

for i in range(M):
    print(t_sum - T[P[i]-1] + X[P[i] - 1])

### FIXED CODE ###

N = int(input())
T = list(map(int, input().split()))
M = int(input())
P, X = [], []
for _ in range(M):
    p, x = map(int, input().split())
    P.append(p)
    X.append(x)

t_sum = sum(T)

for i in range(M):
    print(t_sum - T[P[i]-1] + X[i])
a, b , k = map(int, input().split())
l = list(range(a, b+1))
if k > len(l):
  for i in l:
    print(i)
  quit()
result = l[:k] + l[-k:]
for i in sorted(set(result), key=result.index):
  print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())
if b-a < k:
  for i in range(a, b+1):
    print(i)
else:
  min_a = [i for i in range(a, a+k)]
  max_b = [i for i in range(b, b-k,-1)]
  r = min_a + max_b
  for i in list(sorted(set(r))):
    print(i)
n, m = map(int, input().split())
ship = []
for i in range(m):
    a, b = map(int, input().split())
    if a == 1 or b == n:
        ship.append((a, b))

ship.sort()
i = 0

while ship[i][0] == 1:
    i += 1

for j in range(i):
    for k in range(i, len(ship)):
        if ship[j][1] == ship[k][0]:
            print("POSSIBLE")
            exit()

print("IMPOSSIBLE")


### FIXED CODE ###

n, m = map(int, input().split())
ship_1 = [False]*(n+1)
ship_n = [False]*(n+1)
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        ship_1[b] = True
    elif b == n:
        ship_n[a] = True

for i in range(len(ship_1)):
    if ship_1[i] and ship_n[i]:
        print("POSSIBLE")
        exit()

print("IMPOSSIBLE")
x,y=map(int,input().split());ans=0
if x==y:
  print(-1)
else:
  while True:
    r=x*2
    if r%y!=0:
      print(r)
      break
    elif r>=10**18:
      print(-1)
    i+=1

### FIXED CODE ###

x, y=map(int, input().split())
print(-1 if x%y==0 else x)
H, W = map(int, input().split())
atlas = []
for i in range(H):
  atlas.append(input().split())

def BFS(a,b):
  times = 0
  queue = [[a, b]]
  old_queue = []
  while True:
    new_queue = []
    changed = False
    for x, y in queue:
      if x+1 < H and atlas[x+1][y] != "#" and not [x+1, y] in old_queue:
        new_queue.append([x+1, y])
        old_queue.append([x+1, y])
        changed = True
      if x-1 >= 0 and atlas[x-1][y] != "#" and not [x-1, y] in old_queue:
        new_queue.append([x-1, y])
        old_queue.append([x-1, y])
        changed = True
      if y+1 < W and atlas[x][y+1] != "#" and not [x, y+1] in old_queue:
        new_queue.append([x, y+1])
        old_queue.append([x, y+1])
        changed = True
      if y-1 >= 0 and atlas[x][y-1] != "#" and not [x, y-1] in old_queue:
        new_queue.append([x, y-1])
        old_queue.append([x, y-1])
        changed = True
    queue = new_queue
    if not changed:
      break
    times += 1
  return times

TIMES = 0
for j in range(H):
  for k in range(W):
    if atlas[j][k] == "#":
      break
    new_TIMES = BFS(j, k)
    if new_TIMES > TIMES:
      TIMES = new_TIMES
      
print(TIMES)

### FIXED CODE ###

import numpy as np
H, W = map(int, input().split())
map_lis = [input() for i in range(H)]
ans = 0

def prob(x,y,h,w):
  if 0<=x<h and 0<=y<w:
    return True
  else:
    return False

def count(x,y,lis):
  if not lis[x][y]:
    return True
  else:
    return False

def maze(x,y,lis):
  if lis[x][y] == ".":
    return True
  else:
    return False

for i in range(H):
  for j in range(W):
    k = 0
    count_lis = np.zeros((H,W))
    num_lis = [[] for i in range(1000)]
    if maze(i,j,map_lis):
      count_lis[i][j] = 1
      num_lis[0].append([i,j])
    while True:
      for l in num_lis[k]:
        if prob(l[0]-1,l[1],H,W) and count(l[0]-1,l[1],count_lis) and maze(l[0]-1,l[1],map_lis):
          num_lis[k+1].append([l[0]-1,l[1]])
          count_lis[l[0]-1][l[1]] = 1
        if prob(l[0],l[1]-1,H,W) and count(l[0],l[1]-1,count_lis) and maze(l[0],l[1]-1,map_lis):
          num_lis[k+1].append([l[0],l[1]-1])
          count_lis[l[0]][l[1]-1] = 1
        if prob(l[0]+1,l[1],H,W) and count(l[0]+1,l[1],count_lis) and maze(l[0]+1,l[1],map_lis):
          num_lis[k+1].append([l[0]+1,l[1]])
          count_lis[l[0]+1][l[1]] = 1
        if prob(l[0],l[1]+1,H,W) and count(l[0],l[1]+1,count_lis) and maze(l[0],l[1]+1,map_lis):
          num_lis[k+1].append([l[0],l[1]+1])
          count_lis[l[0]][l[1]+1] = 1
      new_ans = 0
      for m in num_lis[1:]:
        if m != []:
          new_ans += 1
        if m == []:
          break
      ans = max(ans, new_ans)
      k += 1
      if num_lis[k] == []:
        break
                                     
print(ans)
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = permutations_count(N, i)/2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入る場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-i)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum%(10**9+7)))

### FIXED CODE ###

N = int(input())
print((10**N - 9**N - 9**N + 8**N) % (10**9+7))
N,K = map(int,input().split())
h = list(map(int,input().split()))
h.sort()
ans = min(h[i]-h[i+K] for i in range(N-K))
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
h = [int(input()) for i in range(N)]
h.sort(reverse = True)
l = [0]*(N-(K-1))
for i in range(N-(K-1)):
  l[i] = h[i]-h[i+K-1]
ans = min(l)
print(ans)
n = int(input())
l = list(map(int, input().split()))
max_num = 0
max_index = 0
total = 0

for i in range(n):
  if max_num < l[i]:
    max_num = l[i]
    max_index = i


l.pop(max_index)


for i in range(n - 1):
  total += l[i]

if total > max_num: print("Yes")
else: print("No")





### FIXED CODE ###

i = list(map(int, input().split()))
ans = 0.0

if 1 <= i[0] and i[0] <= 100:
  if 1 <= i[1] and i[1] <= 100:
    ans = i[0] / i[1]
    print(ans)
from fractions import math
n, x = tuple(map(int, input().split(' ')))
d = 0
l = list(map(int, input().split(' ')))
for i in range(n):
  s = l[i]
  if i == 0:
    d = abs(s - x)
  else:
    d = math.gcd(d, s-x)
print(d)


### FIXED CODE ###

from fractions import gcd
n, x = tuple(map(int, input().split(' ')))
d = 0
l = list(map(int, input().split(' ')))
for i in range(n):
  s = l[i]
  if i == 0:
    d = abs(s - x)
  else:
    d = gcd(d, abs(s-x))
print(d)
def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	a,b=0,0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(5100)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break

### FIXED CODE ###

def sieve(n):
	p=[True]*(n+1)
	p[0]=p[1]=False
	for i in range(2,int((n+1)*0.5)+1):
		if p[i]==True:
			for j in range(i*i,n+1,i):
				p[j]=False
	prime=[]
	for i in range(n+1):
		if p[i]==True:
			prime.append(i)
	return prime

def solve(n):
	i=0
	while True:
		if n>prime[i]:
			a=prime[i]
		elif n==prime[i]:
			a=prime[i-1]
		else:
			b=prime[i]
			break
		i+=1
	print(a,b)

prime=sieve(50021)
while True:
	try:
		n=int(input())
		solve(n)
	except EOFError:
		break
x,k,d=list(map(int,input.split()))
syou, amari = divmod(x,d)
if x>0:
    if x-k*d==0:
        print(0)
    elif x-k*d<0:
        if amari==0:
            newk=k-syou
            if newk%2==0:
                print(0)
            else:
                print(d)
        elif amari!=0:
            newk=k-syou+1
            if newk%2==0:
                print(abs(x-d*(syou+1)))
            else:
                print(abs(x-d*syou))
    elif x-k*d>0:
        print(abs(x-k*d))
if x==0:
    if k%2==0:
        print(0)
    else:
        print(d)


### FIXED CODE ###

x,k,d=list(map(int,input().split()))
x=abs(x)
syou, amari = divmod(abs(x),d)
if x>0:
    if x-k*d==0:
        print(0)
    elif x-k*d<0:
        if amari==0:
            newk=k-syou
            if newk%2==0:
                print(0)
            else:
                print(d)
        elif amari!=0:
            newk=k-syou+1
            if newk%2==0:
                print(abs(x-d*(syou+1)))
            else:
                print(abs(x-d*syou))
    elif x-k*d>0:
        print(abs(x-k*d))
if x==0:
    if k%2==0:
        print(0)
    else:
        print(d)
a,b=[input() for _ in range(2)]
print('<' if a<b else '>' if a>b else '=')

### FIXED CODE ###

a,b=input().split()
print('<' if a<b else '>' if a>b else '=')
H,A = map(int,input.split())
q,mod= divmod(H,A)

if mod >0:
  q +=1
  
print(q)

### FIXED CODE ###

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

q,mod= divmod(H,A)

if mod > 0:
  q += 1
  
print(int(q))