Harryxun/stf_run huggingface dataset:
s,w = map(inr, input().split())
 
if w <= s:
  print("unsafe")
else:
  print("safe")



### FIXED CODE ###

s,w = map(int, input().split())
 
if w >= s:
  print("unsafe")
else:
  print("safe")
# coding: utf-8
# Your code here!

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

ab_list.sort()

graph = [[] for i in range(N)]
for i in range(N-1):
    graph[ab_list[i][0]-1].append((ab_list[i][1],i))
    graph[ab_list[i][1]-1].append((ab_list[i][0],i))
    
ans = [0 for i in range(N-1)]
ten_col = [[] for i in range(N)]
def dfs(start,now,color):
    ten_col[now-1].append(color)
    for (future,i) in graph[now-1]:
        if future == start:
            pass
        else:
            new_col = 1
            while True:
                if new_col not in ten_col[now-1]:
                    ten_col[now-1].append(new_col)
                    ans[i] = new_col
                    break
                else:
                    new_col += 1
            dfs(now,future,new_col)
            
dfs(-1,1,0)
print(max(ans))
for i in ans:
    print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N = int(input())

graph = [[] for i in range(N)]

for i in range(N-1):
    a,b = map(int,input().split())
    graph[a-1].append((b,i))
    graph[b-1].append((a,i))
    
ans = [0]*(N-1)

def dfs(past,now,edge_col):
    new_col = 1
    for (future,i) in graph[now-1]:
        if future == past:
            pass
        else:
            if new_col == edge_col:
                new_col += 1
            ans[i] = new_col
            dfs(now,future,new_col)
            new_col += 1
            
dfs(-1,1,-1)

print(max(ans))
for i in ans:
    print(i)
import sys
for a,b,c in map(lambda x:sorted(map(int,x.split())),sys.stdin.readlines()):
 print(['NO','YES'][a*a+b*b==c*c])


### FIXED CODE ###

import sys
input()
for a,b,c in map(lambda x:sorted(map(int,x.split())),sys.stdin):
 print(['NO','YES'][a*a+b*b==c*c])
class RollingHash:
    def __init__(self, s: str, base: int=1007, mod: int=10**9+7):
        self.s = s
        self.n = len(s)
        self.base = base
        self.mod = mod

        # preprocess
        self.hash_cum = [0] * (self.n + 1) # hash_cum[i] = (hash of s[:i])
        self.base_pow = [1] * (self.n + 1) # base_pow[i] = base ** i
        for i in range(self.n):
            self.hash_cum[i+1] = (self.hash_cum[i] * base + ord(s[i])) % mod
            self.base_pow[i+1] = (self.base_pow[i] * base) % mod

    def get_hash(self, l: int, r: int) -> int:
        hash_val = self.hash_cum[r] - self.hash_cum[l] * self.base_pow[r-l] % self.mod
        if hash_val < 0:
            hash_val += self.mod
        return hash_val


class RollingHashMulti:
    def __init__(self, s: str, base_list: list=[1007, 2009], mod_list: list=[10**9+7, 10**9+9]):
        self.n = len(base_list)
        self.base_list = base_list
        self.rh_list = [RollingHash(s, base_list[i], mod_list[i]) for i in range(self.n)]

    def get_hash(self, l: int, r: int) -> tuple:
        return tuple( self.rh_list[i].get_hash(l, r) for i in range(self.n) )




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

rh = RollingHashMulti(s)

def check(x):
    for i in range(n-2*x+1):
        for j in range(i+x, n-x+i):
            if rh.get_hash(i, i+x) == rh.get_hash(j, j+x):
                return True
    return False


lb = 0
ub = n // 2 + 1
while ub - lb > 1:
    mid = (ub + lb) // 2
    if check(mid):
        lb = mid
    else:
        ub = mid

print(lb)


### FIXED CODE ###

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

n += 1
s += "#"

ans = 0
for i in range(1, n):
    cnt = 0
    for j in range(n-i):
        if s[i+j] == s[j]:
            cnt += 1
        else:
            ans = max(ans, min(cnt, i))
            cnt = 0

print(ans)
import sys
input = sys.stdin.readline

import numpy as np
import scipy as sp
from collections import Counter, deque

INF = float('inf')
weekly = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']


def main():
    S = input().rstrip()
    index = weekly.index(S)
    print(-(index - len(weekly)))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import Counter, deque

INF = float('inf')
weekly = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']


def main():
    S = input().rstrip()
    index = weekly.index(S)
    print(-(index - len(weekly)))


if __name__ == '__main__':
    main()
s = map(int,input().split())
c = 0
while a[len(s)] % 2 == 0:
    for i in range(len(s)):
        if a[i] % 2 == 0:
            a[i] = a[i] / 2
        c = c + 1
        else:
            break
return c

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
i = 0
odd = 0
while odd == 0:
    for n in range(len(a)):
        if a[n]%2 == 0:
            a[n] /= 2
        else:
            odd = 1
            break
    if odd == 0:
        i += 1
print(i)
print(6-input()-input())

### FIXED CODE ###

print(6-int(input())-int(input()))
k = input()
w = input()
l = len(w)
if l <= k:
 	 print(w)
else:
   	 print(w[:k])


### FIXED CODE ###

k = int(input())
s = input()
if int(len(s)) <= k:
  	print(str(s))
else:
  	print(((str(s))[0:k]) + "...")
a, b = input().split()
n = int(a + b)
for i in range(1000):
        if i * i == n:
            print("Yes")
            exit()
        if i * i > num:
            print("No")
            exit()


### FIXED CODE ###

a,b=input().split()
n=int(a+b)
for i in range(1000):
  if n==i**2:
    print("Yes")
    break
  if n<i**2:
    print("No")
    break
n=int(input())
if(n%2==1)n*=2
print(n)

### FIXED CODE ###

n=int(input())
if(n%2==1):
  n*=2
print(n)
def solve(a):
	if type(a[0]) is int:
		return sum(sorted(a)[:len(a)/2+1])/2 + len(a)
	else:
		return sum(sorted(solve(i) for i in a))[:len(a)/2+1])
for i in range(input()):
	A = eval(raw_input().replace("][","],["))
	print solve(A)

### FIXED CODE ###

def solve(a):
	if type(a[0]) is int:
		return sum(sorted(a)[:len(a)/2+1])/2 + len(a)
	else:
		return sum(sorted(solve(i) for i in a)[:len(a)/2+1])
for i in range(input()):
	A = eval(raw_input().replace("][","],["))
	print solve(A)
a,b,c,x=map(int,input()　for i in range(4))

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

### FIXED CODE ###

a, b, c, x = map(int, [input() for i in range(4)])

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

ans = 0
ACGT = set('A','C','G','T')
for i in len(1,S+1):
  j = 1
  while j*i <= S:
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

### FIXED CODE ###

s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        word = set(s[j:j+i])
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print (ans)
N, A, B = map(input, [input() for i in range(3)])

ans = 0
for i in range(N + 1):
    if A <= sum(map(int, list(str(i)))) <= B:
        ans += 1
print(ans)


### FIXED CODE ###

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

ans = 0
for i in range(N + 1):
    if A <= sum(list(map(int, list(str(i))))) <= B:
        map(int, list(str(i)))
        ans += i
print(ans)
import math
N = int(input())
ans = 1
for i in range(0,N):
    t = int(input())
    ans = int((ans * t) / math.gcd(ans, t))
print(ans)

### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

N = int(input())
ans = 1

for i in range(0,N):
    t = int(input())
    ans = t * ans // gcd(ans, t)

print(ans)
n,m,q = map(int, input().split())
m_dict = dict()
for i in range(1,m+1):
  m_dict[i] = []
for i in range(m):
  s,e = map(int, input().split())
  m_dict[s].append(e)
for i in range(q):
  s,e = map(int, input().split())
  cnt = 0
  for j in range(s,e+1):
    cnt += len([ k for k in m_dict[j] if k <= e ])
  print(cnt)

### FIXED CODE ###

n,m,q = map(int, input().split())
mmap = [ [ 0 for j in range(n+1) ] for i in range(n+1) ]
for i in range(m):
  s,e = map(int, input().split())
  mmap[s][e] += 1
for i in range(n+1):
  for j in range(1,n+1):
    mmap[i][j] = mmap[i][j] + mmap[i][j-1]
for j in range(n+1):
  for i in range(n-1,0,-1):
    mmap[i][j] = mmap[i][j] + mmap[i+1][j]
for i in range(q):
  s,e = map(int, input().split())
  print(mmap[s][e])
import math
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = int(C*D/math.gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

### FIXED CODE ###

from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)
if (int(input())%9 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

if int(input()) % 9 == 0:
  print("Yes")
else:
  print("No")
s = input().split()[1]
s.count("ABC")

### FIXED CODE ###

s = input()
s = input()
print(s.count("ABC"))
b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<1e6:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))


### FIXED CODE ###

b=[1]*500000
for i in range(3,999,2):
 if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i])
def p(x):
 if x<5*1e5:return b[x]
 x=2*x+1
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
print(sum(p(int(input()))for _ in[0]*int(input())))
n,k,*p=map(int,open(0).read().split())
p.sort()
p.reverse()
l=p[:k]
print(l)
_sum=0
before=l[0]
rate=1
for i in range(len(l)):
    s=0
    if i!=0:
        if l[i]==before:
            rate*=2
        else:
            before=l[i]
            rate=1
        for j in range(1,l[i]+1):
            s+=j
        _sum+=s/l[i]/rate          
    else:
        for j in range(1,l[i]+1):
            s+=j
        _sum+=s/l[i]
print(_sum) 

        
        

 


       




























### FIXED CODE ###

n,k,*p=map(int,open(0).read().split())
l=[]
l.append(sum(p[:k]))
for i in range(k,n):
    l.append(l[-1]+p[i]-p[i-k])
ind=l.index(max(l))
ans=0
for i in range(k):
    ans += (1+p[ind+i])/2
print(ans)
cnt = 1
c = input()
while c != 0:
    print('Case '+str(cnt)+': '+c)
    c = input()
    cnt += 1


### FIXED CODE ###

cnt = 1
c = int(input())
while c != 0:
    print('Case ' + str(cnt) + ': ' + str(c))
    c = int(input())
    cnt += 1
a,b = map(int,input().split())
cnt=0
for x in range(a+1):
    for y in range(a+1):
        z = b-x-y
        if 0<=z<=a and x+y+z==b:
            cnt+=1
print(cnt)

### FIXED CODE ###

a=input().split(",")
for i in a:
    print(i,end=" ")
from math import gcd
n = int(input())
l = list(map(int, input().strip().split()))
maxe = -1

for i in range(n):
  for j in range(n):
    g = gcd(l[i],l[j])
    maxe = max(maxe, g)
print(maxe)

### FIXED CODE ###

from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
 
X1 = [0] * (N+2)
X2 = [0] * (N+2)
 
for i in range(N):
    X1[i+1] = gcd(X1[i], A[i])
for i in range(N,0,-1):
    X2[i] = gcd(X2[i+1], A[i-1])

k = []
for i in range(N):
    k.append(gcd(X1[i],X2[i+2]))

print(max(k))
p=print
r=range
def a(i,j,k,l=0):p("+<"[l],i,j,k)
p(6484)
a(0,1,3)
a(2,3,3,1)
for x in r(2):
	a(x,3,x)
	for t in r(30):b(v:=x+4);a(v,3,6),eval('a(6,6,6),'*(29-t));a(6,x,T:=x*60+35+t,1);a(v,T,v)
for t in r(60):a(2,2,2);[(a(34+t-s,95+s,5),a(3,5,6,1),a(2,6,2))for s in r(t)]

### FIXED CODE ###

n=97
r=range
L='<'
P='+'
l=[3933,P,0,1,n,L,2,n,n,P,0,n,3,P,1,n,4]
a=lambda i,j:[P,i,j,i]
b=lambda i:[P,i,i,i+1]
def d(x,i,j):
	return sum([sum([b(j+t-1),a(j+t,n),*(b(s)for s in r(j+t,j+29)),[L,j+29,x,i+t],b(j+t-1),a(j+t,i+t)],[])for t in r(30)],[])
l+=d(3,5,36)
l+=d(4,36,67)
for t in r(59):
	l+=a(2,2)
	for s in r(t+1):
		if t-30<s<30:l+=[P,5+t-s,36+s,98];l+=[L,n,98,99];l+=a(2,99)
print(*l)
import math # 階乗:factorial 切り上げ:ceil 切り捨て:floor
from operator import itemgetter as ig
from collections import defaultdict as dd
# 定数
INF = math.inf
MOD = int(1e9 + 7)

def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    x = sum(A[::2]) - sum(A[1::2])
    r = [x]
    for n in range(N - 1):
        r += [A[n] * 2 - r[-1]]
    print(*r)

main()


### FIXED CODE ###

# 定数
INF = float("inf")
MOD = int(1e9 + 7)

# エントリーポイント
def main():
	# 入力
	N = int(input())
	A = list(map(int, input().split()))

	offset = 0
	for a in A:
		offset = a * 2 - offset
	offset //= 2
	for a in A:
		print(offset)
		offset = a * 2 - offset

main()
from math import factorial
from collections import Counter
 
def conb(n):
    if n == 1:
        return 0
    else:
        return factorial(n) / factorial(2) / factorial(n - 2) 

n = int(input())
S = [''.join(sorted(list(input()))) for i in range(n)]

print(int(sum([conb(i) for i in Counter(S).values()])))

### FIXED CODE ###

from math import factorial
from collections import Counter
 
def conb(n):
    if n <= 1:
        return 0
    else:
        return factorial(n) // factorial(n-2) // factorial(2) 

n = int(input())
S = [''.join(sorted(list(input()))) for i in range(n)]

print(int(sum([conb(i) for i in Counter(S).values()])))
a = list(map(int,input().split())
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))

### FIXED CODE ###

a = list(map(int,input().split()))
print(max(a[0]+a[1],a[0]-a[1],a[0]*a[1]))
import math

n,a,b = map(int,input().split())
mod = 10**9+7
total = pow(2,n,mod) - 1

nPa = math.factorial(n) // math.factorial(n-a) 
nPa %= mod
nPb = math.factorial(n) // math.factorial(n-b) 
nPb %= mod
a!_1 = 1
for i in range(1,a+1):
  a!_1 = pow(i,mod-2,mod)
  a!_1 %= mod
b!_1 = 1
for i in range(1,b+1):
  b!_1 = pow(i,mod-2,mod)
  b!_1 %= mod
nCa = nPa * a!_1
nCb = nPb * b!_1
print((total-nCa-nCb)%mod)

### FIXED CODE ###

mod = 10**9+7
n,a,b = map(int,input().split())
ans = pow(2,n,mod)-1

comb1 = 1 
for i in range(n-a+1,n+1):
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1):
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod

comb2=1
for i in range(n-b+1,n+1):
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
  
ans -= (comb1+comb2)
ans %= mod
print(ans)
from functools import lru_cache

N = int(input().strip())
A = [int(v) for v in input().strip().split()]
C = {}
S = {}


@lru_cache
def calc(C, a):
    C[a] -= 1
    sum_ = sum([S[n] for n in C.values() if n > 1])
    C[a] += 1
    return sum_

for a in A:
    C.setdefault(a, 0)
    C[a] += 1


for i, a in enumerate(A):
    print(calc(C, a))


### FIXED CODE ###

from functools import lru_cache

N = int(input().strip())
A = [int(v) for v in input().strip().split()]
C = {}


@lru_cache(maxsize=None)
def pair(k):
    return k * (k - 1) // 2

@lru_cache(maxsize=None)
def calc(s, a):
    return s - pair(C[a]) + pair(C[a] - 1)

for a in A:
    C.setdefault(a, 0)
    C[a] += 1

S = sum([pair(v) for v in C.values()])

for a in A:
    print(calc(S, a))
import sys
readline=sys.stdin.buffer.readline
n=int(input())
a=[list(map(int, readline().split())) for _ in range(n)]
a.sort(key=lambda x: x[1])
t=0
for i in range(n):
  t+=a[i][0]
  if t>a[i][1]:
    print("No")
    break
  elif i==n-1:
    print("Yes")


### FIXED CODE ###

n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]
a.sort(key=lambda x: x[1])
t=0
for i in range(n):
  t+=a[i][0]
  if t>a[i][1]:
    print("No")
    break
  elif i==n-1:
    print("Yes")
N = int(input())
number = []
    for a in range(1,10):
        for b in range(1,10):
            number.append(b*a)
if N in number :
    print("Yes")
else :
    print("No")

### FIXED CODE ###

N = int(input())
number = []
for a in range(1,10):
    for b in range(1,10):
        number.append(b*a)
if N in number :
    print("Yes")
else :
    print("No")
s=input()
t=input()
a=0
for x in range(s):
  if s[x]!=t[x]:
    a+=1
print(a)

### FIXED CODE ###

s=input()
t=input()
a=0
for x in range(len(s)):
  if s[x]!=t[x]:
    a+=1
print(a)
n=int(input())-1

edges = {}
lens = {}
for _ in range(n):
    [a, b, c] = map(int, input().split())
    if a > b:
        a,b=b,a
    edges.setdefault(a, []).append(b)
    edges.setdefault(b, []).append(a)
    lens[(a,b)] = c

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

used = set()
dists = {}
def build(x, d=0):
    dists[x] = d
    for c in edges[x]:
        if c not in used:
            used.add(c)
            build(c, d + lens[(min(x,c), max(x,c))])

build(k)


for _ in range(q):
    [x, y] = map(int, input().split())
    print(dists[x] + dists[y])

### FIXED CODE ###

n=int(input())-1

edges = {}
lens = {}
for _ in range(n):
    [a, b, c] = map(int, input().split())
    if a > b:
        a,b=b,a
    edges.setdefault(a, []).append(b)
    edges.setdefault(b, []).append(a)
    lens[(a,b)] = c

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

dists = {}
def build(x, d=0):
    ss = [(x, 0)]
    while ss:
        x, d = ss.pop()
        if x not in dists:
            dists[x] = d
            for c in edges.get(x, []):
                ss.append((c, d + lens[(min(x,c), max(x,c))]))

build(k)

for _ in range(q):
    [x, y] = map(int, input().split())
    print(dists[x] + dists[y])
W, H, x, y = map(int, input().split())


ans1_1 = W * (H - y)
ans1_2 = W * y

ans2_1 = x * H
ans2_2 = (W - x) * H

if (x == 0 and y == 0) or (x == W and y == H) or (x == 0 and y == H) or (x == W and y == 0):
    print(W * H / 2, 0)
    
elif x == 0 or x == W 
    print(W * (y + (H - y))/2, 0)
    
elif y == 0 or y == H:
    print(H * (x + (W - x))/2, 0)
    
elif abs(ans1_1 - ans1_2) <  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 0)
    
elif abs(ans1_1 - ans1_2) ==  abs(ans2_1 - ans2_2):
    
    print(min(ans1_1, ans1_2), 1)
    
else:
    print(min(ans2_1, ans2_2), 0)

### FIXED CODE ###

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


if x == W / 2 and y == H / 2:
    print(W*H/2, 1)
else:
    print(W*H/2, 0)
A,B,K = map(int,input().split())

Q = K - A
q = A - K
if Q < 0 :
  print (q)
if Q >= 0 :
  W = B - Q
  if W >= 0:
    print ("0",W)
  if W< 0 :
    print("0 0")

### FIXED CODE ###

S,T = input().split()
print(T+S)
A=int(input())
B=int(input())
C=int(input())
if (A<C and C<B) or (A>C and C>B):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

b=[int(i) for i in input().split()]
if (b[0]<b[2] and b[2]<b[1]) or (b[0]>b[2] and b[2]>b[1]):
    print("Yes")
else:
    print("No")
a, b, c = map(int, input().split())

if a == 5:
  if (b == 5 and c == 7) or (c == 5 and b == 7):
    print(YES)
  else:
    print(NO)
if a == 7:
  if b == 5 and c == 5:
    print(YES)
  else:
    print(NO)

### FIXED CODE ###

a, b, c = map(int, input().split())
 
if a == 5:
  if (b == 5 and c == 7) or (c == 5 and b == 7):
    print("YES")
  else:
    print("NO")
if a == 7:
  if b == 5 and c == 5:
    print("YES")
  else:
    print("NO")
a,b,c = map(str,input().split())
if b == '+':
  print(int(a)+int(b))
else:
  print(int(a)-int(b))

### FIXED CODE ###

a,b,c = map(str,input().split())
if b == '+':
  print(int(a)+int(c))
else:
  print(int(a)-int(c))
n,m = map(int,input().split())
if m != 0:
  a = [list(map(int,input().split())) for raw in range(m)]
  b = sorted(a)
ans = 0
if int((b[0])[0]) != 1:
  ans += 10**(n-1)
t = 0
u = -1
che = 0
for hoge in b:
  x = hoge[0]
  y = hoge[1]
  if x == 1 and y == 0:
    che += 1
  if x != t:
    ans += y*(10**(n-x))
  if x == t and y != u:
    che +=1
  t = x
  u = y
if che == 0 and ans !=0:
  print(ans)
elif che == 0 and n == 1:
  print(0)
else:
  print(-1)

### FIXED CODE ###

n,m = map(int,input().split())
if m != 0:
  a = [list(map(int,input().split())) for raw in range(m)]
  b = sorted(a)
  ans = 0
  if int((b[0])[0]) != 1:
    ans += 10**(n-1)
  t = 0
  u = -1
  che = 0
  for hoge in b:
    x = hoge[0]
    y = hoge[1]
    if x == 1 and y == 0:
      if n != 1:
        che += 1
    if x != t:
      ans += y*(10**(n-x))
    if x == t and y != u:
      che +=1
    t = x
    u = y
  if che == 0 and ans !=0:
    print(ans)
  elif che == 0 and n == 1:
    print(0)
  else:
    print(-1)
else:
  if n == 1:
    print(0)
  else:
    print(10**(n-1))
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


b, c = map(int, input().split())

s=b*c

if s%2==1:
  print("Odd")
else:
  prinnt("Even")




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 21:46:51 2018

@author: sk
"""


b, c = map(int, input().split())

s=b*c

if s%2==1:
  print("Odd")
else:
  print("Even")
from namba import njit

@njit
def main():
    S = input()
    L = len(S)
    amari = [0] * 2019
    tmp = 0
    for i in range(L):
        tmp += int(S[-i-1])*(10**i)%2019
        tmp %= 2019
        amari[tmp] += 1
    ans = amari[0]
    for i in range(2019):
        ans += amari[i]*(amari[i]-1)//2
    print(ans)
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

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

INF = float('inf')


def main():
    s = map(int, input()[::-1])
    mod = 2019
    counts = [0] * mod
    counts[0] = 1
    t = 0
    x = 1
    for num in s:
        t = (t + num * x) % mod
        counts[t] += 1
        x = (x * 10) % mod
    ans = 0
    for count in counts:
        if count > 1:
            ans += count * (count - 1) // 2
    print(ans)


if __name__ == '__main__':
    main()
n = int(input())
s = input()
ans = s.count('B') * s.coufnt('G') * s.count('R')
for i in range(n):
  for j in range(i, n-1):
    k = 2*j - i
    if k >= n:
      continue
    if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
      ans -= 1

print(ans)


### FIXED CODE ###

n = int(input())
s = input()
ans = s.count('R') * s.count('G') * s.count('B')
for i in range(n):
  for j in range(i, n-1):
    k = 2*j - i
    if k >= n:
      continue
    if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
      ans -= 1

print(ans)
# -*- coding: utf-8 -*-


def solve(s_pp, p_pp):
    p_nums = []
    for x, y in s_pp:
        distance = []
        for xx, yy in p_pp:
            n = abs(x - xx) + abs(y - yy)
            distance.append(n)
        min_distance_idx = distance.index(min(distance))
        p_nums.append(min_distance_idx + 1)
    return p_nums


def main():
    students, points = [int(e) for e in input().split()]
    students_ps = []
    points_ps = []

    for _ in range(students):
        x, y = [int(e) for e in input().split()]
        students_ps.append([x, y])
    for _ in range(points):
        x, y = [int(e) for e in input().split()]
        points_ps.append([x, y])
    
    for answer in solve(students_ps, points_ps):
        print(answer)


m

### FIXED CODE ###

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


def solve(s_pp, p_pp):
    p_nums = []
    for x, y in s_pp:
        distance = []
        for xx, yy in p_pp:
            n = abs(x - xx) + abs(y - yy)
            distance.append(n)
        min_distance_idx = distance.index(min(distance))
        p_nums.append(min_distance_idx + 1)
    return p_nums


def main():
    students, points = [int(e) for e in input().split()]
    students_ps = []
    points_ps = []

    for _ in range(students):
        x, y = [int(e) for e in input().split()]
        students_ps.append([x, y])
    for _ in range(points):
        x, y = [int(e) for e in input().split()]
        points_ps.append([x, y])
    
    for answer in solve(students_ps, points_ps):
        print(answer)


main()