Harryxun/stf_run huggingface dataset:
from collections import deque

class RollingHash():
    def __init__(self, s, base1=19683,base2=6561,mod1=2^61-1,mod2=2^61-1):
        self.mod1 = mod1
        self.mod2 = mod2
        self.s = s
        n = len(s)
        self.hash1 = [0]*(n+1)
        self.pow1 = [1]*(n+1)
        self.hash2 = [0]*(n+1)
        self.pow2 = [1]*(n+1)
        for i in range(n):
            self.hash1[i+1] = (self.hash1[i]*base1 + ord(s[i])) % self.mod1
            self.pow1[i+1] = (self.pow1[i]*base1) % self.mod1
            self.hash2[i+1] = (self.hash2[i]*base2 + ord(s[i])) % self.mod2
            self.pow2[i+1] = (self.pow2[i]*base2) % self.mod2

    def get(self, l, r):
        h1 = (self.hash1[r] - self.hash1[l] * self.pow1[r-l]) % self.mod2
        h2 = (self.hash2[r] - self.hash2[l] * self.pow2[r-l]) % self.mod2
        return (h1,h2)


n = int(input())
s = input()
rh = RollingHash(base1=1007,base2=2009,mod1=10**9+7,mod2=10**9+9)

for len_ in range(n//2,0,-1):
    ql = [(-1,-1)]*(len_-1)
    wait_q = deque(ql)
    hset = set()
    print(len_)
    for i in range(n-len_+1):
        print(s[i:i+len_])
        hs = rh.get(i,i+len_)
        if hs in hset:
            print(len_)
            exit()
        else:
            wait_q.append(hs)
            hset.add(wait_q.popleft())
        print(wait_q)
        print(hset)

else:
    print(0)

### FIXED CODE ###

from collections import deque

class RollingHash():
    def __init__(self, s, base1=19683,base2=6561,mod1=2^61-1,mod2=2^61-1):
        self.mod1 = mod1
        self.mod2 = mod2
        self.s = s
        n = len(s)
        self.hash1 = [0]*(n+1)
        self.pow1 = [1]*(n+1)
        self.hash2 = [0]*(n+1)
        self.pow2 = [1]*(n+1)
        for i in range(n):
            self.hash1[i+1] = (self.hash1[i]*base1 + ord(s[i])) % self.mod1
            self.pow1[i+1] = (self.pow1[i]*base1) % self.mod1
            self.hash2[i+1] = (self.hash2[i]*base2 + ord(s[i])) % self.mod2
            self.pow2[i+1] = (self.pow2[i]*base2) % self.mod2

    def get(self, l, r):
        h1 = (self.hash1[r] - self.hash1[l] * self.pow1[r-l]) % self.mod1
        h2 = (self.hash2[r] - self.hash2[l] * self.pow2[r-l]) % self.mod2
        return (h1,h2)


n = int(input())
s = input()
rh = RollingHash(s,base1=1007,base2=2009,mod1=10**9+7,mod2=10**9+9)

for len_ in range(n//2,0,-1):
    ql = [(-1,-1)]*(len_-1)
    wait_q = deque(ql)
    hset = set()
    # print(len_)
    for i in range(n-len_+1):
        # print(s[i:i+len_])
        hs = rh.get(i,i+len_)
        if hs in hset:
            print(len_)
            exit()
        else:
            wait_q.append(hs)
            hset.add(wait_q.popleft())
        # print(wait_q)
        # print(hset)

else:
    print(0)
s_list = list(input())
s_list1 = s_list
count = 0

if s_list[0] == "A":
    del s_list[:2], s_list[-1]
    for i in range(len(s_list)):
        if s_list[i] == "C":
            count += 1
            isC = i + 2
    if count != 1:
        print("WA")
    else:
        del s_list1[isC]
        Str = "".join(s_list1)
        if Str.islower():
            print("AC")
        else:
            print("WA")
else:
    print("WA")

### FIXED CODE ###

s_list = list(input())
s_list1 = s_list[1:]
count = 0

if s_list[0] == "A":
    del s_list[:2], s_list[-1]
    for i in range(len(s_list)):
        if s_list[i] == "C":
            count += 1
            isC = i + 1
    if count != 1:
        print("WA")
    else:
        del s_list1[isC]
        Str = "".join(s_list1)
        if Str.islower():
            print("AC")
        else:
            print("WA")
else:
    print("WA")
S=input()
total=0

for i in range(ren(S)):
    if  i%2=0:
        if  (S[i]=='R')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1
    else:
        if  (S[i]=='L')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1

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

### FIXED CODE ###

S=input()
total=0

for i in range(len(S)):
    if  (i%2)==0:
        if  (S[i]=='R')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1
    else:
        if  (S[i]=='L')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1

if  total==0:
    print('Yes')
else:
    print('No')
N,K=map(int,input().split())
ans=[0]*10**13
for i in range(N):
    a,b=map(int,input().split())
    ans[a]+=b
for i in range(len(ans)):
    cnt+=ans[i]
    if cnt<K:
        continue
    else:
        print(ans[i])
        exit()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################
 
N, K = map(int, input().split())
 
ans = [0] * (10**5+1)
for i in range(N):
    a, b = map(int, input().split())
    ans[a] += b
 
remain = K
for i in range(10**5+1):
    if ans[i] == 0:
        continue
 
    remain -= ans[i]
    if remain <= 0:
        print(i)
        exit()
HK = list(map(int,input().split(" ")))
HP = list(map(int,input().split(" ")))
H = HK[0]
K = HK[1]
HP.sort(reverse=Ture)
sum_a = sum(HP[K:N])
print(sum_a)

### FIXED CODE ###

HK = list(map(int,input().split(" ")))
HP = list(map(int,input().split(" ")))
H = HK[0]
K = HK[1]
HP.sort(reverse=True)
sum_a = sum(HP[K:])
print(sum_a)
import math

a, b, x = map(int, input().split())

if b >= a:
    theta = 0.5 * math.asin((4*x)/(b*b*a))
    print(90 - math.degrees(theta))
else:
    theta = math.atan((2*(a*a*b-x))/(a*a*a))
    print(math.degrees(theta))


### FIXED CODE ###

import math

a, b, x = map(int, input().split())

if a*a*b/2 > x:
    theta = math.atan((2*x)/(b*b*a))
    print(90 - math.degrees(theta))
else:
    theta = math.atan((2*(a*a*b-x))/(a*a*a))
    print(math.degrees(theta))
N = input()

tnum = 0
iter_num = 0

for i in range(N):
    res = 0
    num = i+1
    while num % 2 == 0:
        num /= 2
        res += 1
    if iter_num < res:
        iter_num = res
        tnum = i+1

print(tnum)


### FIXED CODE ###

N = int(input())

tnum = 0
iter_num = 0

for i in range(N):
    res = 0
    num = i+1
    while num % 2 == 0:
        num /= 2
        res += 1
    if iter_num <= res:
        iter_num = res
        tnum = i+1

print(tnum)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

from collcections import defaultdict
import math
n,m = map(int, input().split())
s = input()
t = input()
g = math.gcd(n,m)
d = defaultdict(list)
for i in range(n):
    ind = i*(m//g)
    d[ind].append(s[i])
for i in range(m):
    ind = i*(n//g)
    d[ind].append(t[i])
for k,v in d.items():
    if v and not all(item==v[0] for item in v):
        ans = -1
        break
else:
    ans = n*m//g
print(ans)

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

from collections import defaultdict
import math
n,m = map(int, input().split())
s = input()
t = input()
g = math.gcd(n,m)
d = defaultdict(list)
for i in range(n):
    ind = i*(m//g)
    d[ind].append(s[i])
for i in range(m):
    ind = i*(n//g)
    d[ind].append(t[i])
for k,v in d.items():
    if v and not all(item==v[0] for item in v):
        ans = -1
        break
else:
    ans = n*m//g
print(ans)
a, b = map(int,input().split())
if str(int(str(a) + str(b))**0.5) % 1 == "0":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b = map(int,input().split())
ab = int(str(a) + str(b))
abroot = str(ab**0.5)
if abroot.split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")
n,m,*a=map(int,open(0).read().split())
d=[0]+[-1]*n
for i in range(n):d[i+1]=max(j+d[i-int('0144345265'[j])]*10for j in a)
print(d[n])

### FIXED CODE ###

n,m,*a=map(int,open(0).read().split())
d=[]
for i,j in((7,3),(9,6),(8,7),(6,6),(5,5),(4,4),(3,5),(1,2),(2,5)):
    if i in a:
        d.append((i,j))
dp=[0]*-~n
for i in range(1,n+1):
    for j,k in d:
        if i-k<0 or i-k!=0 and not dp[i-k]:continue
        dp[i]=max(dp[i],dp[i-k]*10+j)
print(dp[n])
class BinaryIndexedTree:
  def __init__(self, size):
    self.data = [0] * (size+1)
    self.size = size
  
  def add(self, i, w):
    while i <= self.size:
      self.data[i] += w
      i += i & -i

  def sum(self, i):
    result = 0
    while i > 0:
      result += self.data[i]
      i -= i & -i
    return result

from itertools import accumulate,repeat

N,K = map(int, input().split())

B = [0] + [sa-sk for sa,sk in zip(accumulate(int(input())), accumulate(repeat(K, N)))]

lookup = dict(((b,i+1) for i,b in enumerate(sorted(B))))

result = 0
bit = BinaryIndexedTree(N+1)

for b in B:
  c = lookup[b]
  result += bit.sum(c)
  bit.add(c,1)

print(result)

### FIXED CODE ###

class BinaryIndexedTree:
  def __init__(self, size):
    self.data = [0] * (size+1)
    self.size = size
  
  def add(self, i, w):
    while i <= self.size:
      self.data[i] += w
      i += i & -i

  def sum(self, i):
    result = 0
    while i > 0:
      result += self.data[i]
      i -= i & -i
    return result

from bisect import bisect

N,K = map(int, input().split())

A = [int(input()) for i in range(N)]

t = 0
B = [t]
for a in A:
  t += a - K
  B.append(t)

temp = sorted(B)
C = [bisect(temp, b) for b in B]

result = 0
bit = BinaryIndexedTree(N+1)

for c in C:
  result += bit.sum(c)
  bit.add(c,1)

print(result)
N=int(input())
A=[int(i) for i in input().split()]
Q=int(input())
X=[i+1 for i in range((10**5))]
dic={}
ans=sum(A)
for i in A:
	try:
		dic[i]+=1
	except:
		dic.setdefault(i,1)
for i in range(Q):
	[B,C]=[int(i) for i in input().split()]
	ans+=dic[B]*(C-B)
	try:
		dic[C]+=1
	except:
		dic.setdefault(C,1)
	print(ans)


### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]
Q=int(input())
X=[i+1 for i in range((10**5))]
dic={}
ans=sum(A)
for i in A:
	try:
		dic[i]+=1
	except:
		dic.setdefault(i,1)
for i in range(Q):
	[B,C]=[int(i) for i in input().split()]
	try:
		ans+=dic[B]*(C-B)
		try:
			dic[C]+=dic[B]
		except:
			dic.setdefault(C,dic[B])
		dic[B]=0
	except:
		ans+=0
	print(ans)
ans = 1001
N,T = map(int,input().split())
for i in range(N):
  c,t = map(int,input().split())
  if t <= T and c <= ans
    ans = c
  if ans = 1001:
    print("TLE")
  else:
    print(ans)

### FIXED CODE ###

n,o = map(int, input().split())
ans = 1001
for i in range(n):
  c,t = map(int, input().split())
  if t <= o and c <= ans:
    ans =  c
if ans == 1001 : print("TLE")
else : print(ans)
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")
n,m=map(int,input().split())
a = [0]*m
for i in range(m):
  a[i] = int(input())-1

s=[0]*n
if a[0] == 0:
  s[0] = 0
  s[1] = 1
elif a[1] == 1:
  s[0] = 1
  s[1] = 0
else:
  s[0] = 1
  s[1] = 2
  
for i in range(2,n):
  #壊れている
  if i in a:
    s[i] = 0
  else:
    s[i] = s[i-1]+s[i-2]
print(s[n-1]%1000000007)

### FIXED CODE ###

n,m=map(int,input().split())
a = [0]*n
if n!=1:
  if m!=0:
    for i in range(m):
      a[int(input())-1] = 1

  s=[0]*n
  if a[0]==1 and a[1] == 1:
    s[0] = 0
    s[1] = 0
  elif a[0] == 1:
    s[0] = 0
    s[1] = 1
  elif a[1] == 1:
    s[0] = 1
    s[1] = 0
  else:
    s[0] = 1
    s[1] = 2

  for i in range(2,n):
    #壊れている
    if a[i] == 1:
      s[i] = 0
    else:
      s[i] = s[i-1]+s[i-2]
  print(s[n-1]%1000000007)
else:
  print(1)
import numpy as np
from collections import deque
import sys


sys.setrecursionlimit(10000)
h, w = map(int, input().split())
a = []
d = deque([])
memo = [[-1]*w for j in range(h)]
for i in range(h):
    a.append(list(input()))
    for j, s in enumerate(a[i]):
        if s == '#':
            d.append([i, j])
            memo[i][j] = 0


def d_list_update(d, hmax, wmax):
    move = [[1, 0], [0, 1], [-1, 0], [0, -1]]
    dh, dw = d.popleft()
    for i, j in move:
        if (0 <= dh + i < hmax) and (0 <= dw + j < wmax):
            if memo[dh + i][dw + j] == -1:
                memo[dh + i][dw + j] = memo[dh][dw] + 1
                d.append([dh + i, dw + j])
    return d


def abc(d, hmax, wmax):
    d = d_list_update(d, hmax, wmax)
    if d:
        abc(d, hmax, wmax)
    return 0


abc(d, h, w)
ans = np.amax(np.array(memo))
print(ans)

### FIXED CODE ###

from collections import deque
 
 
h, w = map(int, input().split())
hs, ws = set(range(h)), set(range(w))
d = deque()
memo = [[-1] * w for j in hs]
move = [[1, 0], [0, 1], [-1, 0], [0, -1]]
a = tuple(input() for _ in hs)
b = [[i, j] for i in hs for j in ws if a[i][j] == '#']
for i, j in b:
    d.append((i, j))
    memo[i][j] = 0
while d:
    dh, dw = d.popleft()
    for i, j in move:
        dhn, dwn = dh + i, dw + j
        if (0 <= dhn < h) and (0 <= dwn < w) and (memo[dhn][dwn] < 0):
            d.append((dhn, dwn))
            memo[dhn][dwn] = memo[dh][dw] + 1
ans = max([max(e) for e in memo])
print(ans)
import math

n = int(raw_input())
a = raw_input().split()

cnt = 0
for i in a:
    a[cnt] = int(i)
    cnt += 1

chk = {}
def make_divisors(k):
    divisors = []
    for i in range(1, int(k**0.5)+1):
        if k % i == 0:
            #divisors.append(i)
            if i in chk:
                chk[i] += 1
            else:
                chk[i] = 1
            if i != k // i:
                #divisors.append(n//i)
                key = int(k//i)
                if key in chk:
                    chk[key] += 1
                else:
                    chk[key] = 1

    # divisors.sort()
    return divisors

if n == 2:
    print max(a[0],a[1])
else:
    for i in range(2):
        make_divisors(a[i])
    for i in reversed(range(2,len(a))):
        k = a[i]
        chk2 = chk
        for j in chk:
            if k % j == 0:
                chk[j] += 1
            if chk[j] < i:
                #del chk2[j]
                continue
        chk = chk2
    answer = 0
    for i in chk:
        if int(chk[i]) >= n - 1:
            answer = i
    print answer

### FIXED CODE ###

import math
import re

a,b,t = raw_input().split()
#s = list(raw_input())

a = int(a)
b = int(b)
t = int(t)

now = a
total = 0
while True:
    if now < t + 0.5:
        total += b
        now += a
    else:
        break

print total
n = int(input())
x = list(input())

counter = sum(list(map(int, x)))
number = int(''.join(x), 2)

def f(num, cnt):
    if num == 0:
        return cnt
    popcount = sum(list(map(int, format(num, 'b'))))
    return f(num % popcount, cnt+1)

for i in range(n):    
    if x[i] == '0':
        m = number + pow(2, n-i-1)
        print(f(m % (counter+1), 1))
    if x[i] == '1':
        m = number - pow(2, n-i-1)
        print(f(m % (counter-1), 1))


### FIXED CODE ###

n = int(input())
x = list(input())

count = x.count('1')
one_count = count - 1
zero_count = count + 1

one_mod = 0
zero_mod = 0
for b in x:
    if one_count:
        one_mod = (one_mod * 2 + int(b)) % one_count
    zero_mod = (zero_mod * 2 + int(b)) % zero_count

f = [0] * 2000001
pop_count = [0] * 200001
for i in range(1, 200001):
    pop_count[i] = pop_count[i//2] + i % 2
    f[i] = f[i % pop_count[i]] + 1

for i in range(n):
    if x[i] == '1':
        if one_count:
            nxt = one_mod
            nxt -= pow(2, n-i-1, one_count)
            nxt %= one_count
            print(f[nxt] + 1)
        else:
            print(0)
    if x[i] == '0':
        nxt = zero_mod
        nxt += pow(2, n-i-1, zero_count)
        nxt %= zero_count
        print(f[nxt] + 1)
a, p = (int(v) for f in input().split(' '))
print((a*3 + p)//2)

### FIXED CODE ###

a, p = (int(v) for v in input().split(' '))
print((a*3 + p)//2)
OK = "O"
BRO = "B"

N,M=map(int, input().split())
Broken=[int(input()) for i in range(M)]
K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
        
if BRO+BRO in K:
  print(0)
else:
  c=[0 for i in range(N+1)]
  if K[N-1]==OK:
    c[1]=1
  if K[N-2]==OK and K[N-1]==OK:
    c[2]=2
  if K[N-2]==OK and K[N-1]==BRO:
    c[2]=1

  for i in range(3,N+1):
    if K[N-i]==OK:
      if K[N-i+1]==OK and K[N-i+2]==OK:
        c[i]=c[i-1]+c[i-2]
      if K[N-i+1]==OK and K[N-i+2]==BRO:
        c[i]=c[i-1]
      if K[N-i+1]==BRO and K[N-i+2]==OK:
        c[i]=c[i-2]
    c[i]%=1000000007
  
  print(c[N] % 1000000007)


### FIXED CODE ###

OK = 0
BRO = 1
MOD = 1000000007

N,M=map(int, input().split())
Broken=[int(input()) for i in range(M)]
#K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))
K = list(0 for i in range(N+1))
for i in range(M):
  K[Broken[i]] = 1
  
dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(N):
  for j in range(i+1,min(i+2+1,N+1)):
    if K[j]==OK:
      dp[j]+=dp[i]
      dp[j]%=MOD
      
print(dp[N])
x = input()
y = input()


cnt = 0

while x <= y:
    x *= 2
    cnt += 1

print (cnt)

### FIXED CODE ###

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

cnt = 0

while x <= y:
    x *= 2
    cnt += 1

print (cnt)
result = 0
for i in range(3):
  if T[i] == S[i]:
    result +=1
print(result)

### FIXED CODE ###

S = input()
T = input()
c = 0
for i in range(3):
	if S[i]==T[i]: c += 1
print(c)
import sys
sys.setrecursionlimit(10**5 + 1)
import numpy as np
N, M = map(int, input().split())
path = np.zeros((N+1, N+1), dtype=np.int64)
 
def judge(bool_array):
  for index, bool_value in enumerate(bool_array[1:], 1):
    if bool_value > path[index, 0]:
      # print('index={}, bool_value={}'.format(index, bool_value))
      plus_value = bool_value - path[index, 0]
      np.where(path[index, 1:] > 0, path[index, 1:]+plus_value, 0)
      path[index, 0] = bool_value
      judge(path[index, :1])

for _ in range(M):
  x, y = map(int, input().split())
  # print('x={}, y={}'.format(x, y))
  path[x, y] = path[x, 0] + 1
  bool_array = np.zeros(N+1, dtype=np.int64)
  bool_array[y] = path[x, y]
  judge(bool_array)
  # print(path)
print(path[:, 0].max())

### FIXED CODE ###

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

N, M = map(int, input().split())
nodes = [[] for _ in range(N)]

for _ in range(M):
  x, y = map(int, input().split())
  nodes[x-1].append(y-1)

dp = [-1] * N

def judge(index):
  if dp[index] != -1:
    return dp[index]
  else:
    edges = 0
    for i in nodes[index]:
      edges = max(edges, 1+judge(i))
    dp[index] = edges
    return edges

answer = 0  
for i in range(N):
  answer = max(answer, judge(i))
print(answer)
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
mod = 10**9 + 7
ans = 0

for j in reversed(range(61)):
    one = 0
    zero = 0
    for i in range(n):
        b = str(bin(a[i]))[2:]
        c = b.zfill(60)
        s = int(c[j])
        if s==0:
            zero += 1
        else:
            one += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**(60-j)) % mod
print(ans%mod)

### FIXED CODE ###

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

def myinput():
    return map(int,readline().split())

n = int(readline())
a = list(myinput())
mod = 10**9 + 7
ans = 0

for j in range(60):
    k = 2**j
    one = 0
    zero = 0
    for i in range(n):
        if (a[i]&k):
            one += 1
        else:
            zero += 1
    ans_bit = zero * one
    ans += (ans_bit)*(2**j) 
    ans %= mod   

print(ans%mod)
N = int(input)
if (N%1000==0):
  print(0)
else:
  print(1000 - (N%1000))

### FIXED CODE ###

N = int(input())
if (N%1000==0):
  print(0)
else:
  print(1000 - (N%1000))
import math
a=int(input())
b=[]
ans=0
for i in range(1,int(math.sqrt(a)),1):
  if a%i==0:
    b=b+[i]+[int(a/i)]
b.remove(1)
for i in b:
  cnt=0
  if a%i==0:
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
print(int(ans))

### FIXED CODE ###

import math
a=int(input())
ans=0
for i in range(1,int(math.sqrt(a)),1):
  if a%i==0 and not i==1:
    cnt=0
    while a%i==0:
      cnt+=1
      a=a/i
    ans+=(math.sqrt(2*cnt+0.25)-0.5)//1
if not a==1:
  print(int(ans+1))
else:
  print(int(ans))
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?'
        T[i] = 'D'
    elif T[i] == '?' and T[i + 1] == 'D':
        T[i] = 'P'
    elif T[i] == '?' and T[i + 1] == '?':
        T[i] = 'P'
        T[i + 1] = 'D'
        i += 1
    elif T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')


### FIXED CODE ###

T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')
A,B = map(int, input().split())  
if A<=9 && B<=9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

A,B = map(int, input().split())  
if A<=9 and B<=9:
  print(A*B)
else:
  print(-1)
import numpy as np

W,H,N = map(int,input().split())
l = np.zeros((H,W)) 

for i in range(N):
  x,y,a = map(int,input().split())

  if a==1:
    l[:,:x] = 1
    #print(l[:,x:])
  elif a==2:
    l[:,x:] = 1
  elif a==3:
    l[:y,:] = 1
  elif a==4:
    l[y:,:] = 1
print(H*W-int(l.sum()))


### FIXED CODE ###

W,H,N = map(int,input().split())
w = W*[1]
h = H*[1]

for n in range(N):
  x,y,a = map(int,input().split())
  if a == 1:
    w[:x] = x*[0]
  elif a == 2:
    w[x:] = (W-x)*[0]
  elif a == 3:
    h[:y] = y*[0]
  else:
    h[y:] = (H-y)*[0]

print(w.count(1)*h.count(1))
a, b, c = map(int, raw_input().split())
num = [a, b, c]
num.sort()
for i in num
   print i,

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
num = [a, b, c]
num.sort()
print num[0], num[1], num[2]
# coding: utf-8
# Your code here!

import math 

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



for i in range(1,k+1):
    a = 1
    b = 1
    for j in range(1,i+1):
        a *= (n-k+2-j)/j
        a = int(a)
    for j in range(1,i):
        b *= (k-j)/j
        b = int(b)
    a = int(a)
    b = int(b)
    a %= 10**9+7
    b %= 10**9+7
    print(a*b%(10**9+7))


### FIXED CODE ###

# coding: utf-8
# Your code here!


from scipy.misc import comb
mod = 10**9 + 7

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

for i in range(1,k+1):
    a = int(comb(k-1, i-1, exact=True)) % mod
    b = int(comb(n-k+1, i, exact=True)) % mod 
    print(a*b%mod)
N, M = list(map(int, input().split()))

p = []
tmp_p = [0]*N
S = []

wa = 0
ac = 0

for i in range(M):
    P, s = list(map(str, input().split()))

    if s == 'AC' and P not in p:
        ac += 1
        p.append(P)
        wa += tmp_p[int(P)-1]
    if s == 'WA' and P not in p:
        tmp_p[int(P)-1] += 1


print(ac, wa)



### FIXED CODE ###

C = input()

print(chr(ord(C)+1))
if __name__ == '__main__':
    a = [float(i) for i in input().split()]
    b= int(a[0])
    c = int(a[1]*100)
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)



### FIXED CODE ###

import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    a = [str(i) for i in input().split()]
    b = int(a[0])
    c = int(a[1].replace(".",""))
    d = Decimal(a[0]) * Decimal(c) / Decimal(100)
    e = int(d)
    print(e)
s = input()

ans = 'keyence'

for i in range(len(s)):
    if s[i]==ans[0]:
        ans=ans[1:]
if ans=='':
    print('YES')
else:
    print('NO')

### FIXED CODE ###

s = input()

for i in range(len(s)):
    for j in range(i,len(s)):
        if s[:i]+s[j:]=='keyence':
            print('YES')
            exit()
print('NO')
N,D=input().split()
N=int(N)
D=int(D)
cnt = 0
for i in range(N):
    
    p1,p2 = map(int,input().split())
    t = ((p1*p1)(p2*p2))**(0.5)
    if t >= D:
        cnt += 1
    
print(cnt)

### FIXED CODE ###

n,d = map(int,input().split())
ans = 0
k = d**2
for i in range(n):
  
    x,y = map(int,input().split())
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)