Harryxun/stf_run huggingface dataset:
import collections

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

s = {i:[] for i in range(m+1)}
for i in range(m):
    a,b = map(int,input().split())
    s[a].append(b)
    s[b].append(a)

bfs = [0]*(n+1)
bfs[1] = s[1][0]
q = collections.deque()
q.append({1:s[1]})

now = 1
while  q:
    tmp = q.popleft()#現在地点からたどり着ける部屋の辞書
    for k,v in tmp.items():
        for room in v:
            if bfs[room] == 0:
                bfs[room] = k
                q.append({room:s[room]})

if bfs.count(0) <= 1:
    print("Yes")
    for i in bfs[2:]:
        print(i)
else:
    print("No")

### FIXED CODE ###

import collections

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

s = {i:[] for i in range(n+1)}
for i in range(m):
    a,b = map(int,input().split())
    s[a].append(b)
    s[b].append(a)

bfs = [0]*(n+1)
try:
    bfs[1] = s[1][0]
except IndexError:
    print("No")
    exit()
q = collections.deque()
q.append({1:s[1]})

while  q:
    tmp = q.popleft()#現在地点からたどり着ける部屋の辞書
    for k,v in tmp.items():
        for room in v:
            if bfs[room] == 0:
                bfs[room] = k
                q.append({room:s[room]})

if bfs.count(0) <= 1:
    print("Yes")
    for i in bfs[2:]:
        print(i)
else:
    print("No")
N = int(input())
ans = 0

#Pythonのfor文range()の右側<最大値>は書いている値から-1されるものなので、注意する。(+1する)

for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)


### FIXED CODE ###

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


#容器1に残りどの位の容量があるか。
D = C-(A-B)

if D>=0:
    print(D)
else:
    print("0")
H,W=map(int,input().split())
S=[input() for i in range(H)]
ans="No"
for i in range(H):
    for j in range(W):
        if S[i][j]=='#':
            if i>0 and S[i-1][j]=='#':
                ans="Yes"
            if i<H-1 and S[i+1][j]=='#':
                ans="Yes"
            if j>0 and S[i][j-1]=='#':
                ans="Yes"
            if j<W-1 and S[i][j+1]='#':
                ans="Yes"
print(ans)

### FIXED CODE ###

H,W=map(int,input().split())
S=[input() for i in range(H)]
ans="Yes"
for i in range(H):
    for j in range(W):
        Tonari=[]
        if i>0:
            Tonari.append(S[i-1][j])
        if i<H-1:
            Tonari.append(S[i+1][j])
        if j>0:
            Tonari.append(S[i][j-1])
        if j<W-1:
            Tonari.append(S[i][j+1])
        if S[i][j]=='#' and all([t=='.' for t in Tonari]):
            ans="No"
print(ans)
while a, b = (int(x) for x in input().split()):
    print(a + b)


### FIXED CODE ###

while True:
    try:
        a, b = (int(x) for x in input().split())
        print(len(str(a + b)))
    except:
        break;
L=int(input())
A=[int(input()) for i in range(L)]
su=sum(A)
#print(A)

DP=[[0 for i in range(5)] for j in range(L)]

mod=A[0]%2
if A[0]==0 :
    mod=2
DP[1]=[A[0],min(A[0],mod%2),min(A[0],mod%2,(mod+1)%2),min(A[0],mod%2,(mod+1)%2),min(A[0],mod%2,(mod+1)%2)]

for i in range(2,L):
    mod=A[i]%2
    if A[i]==0 :
        mod=2
    DP[i][0]+=DP[i-1][0]+A[i]
    DP[i][1]+=min(DP[i-1][0],DP[i-1][1])+mod
    DP[i][2]+=min(DP[i-1][j] for j in range(3))+(mod+1)%2
    DP[i][3]+=min(DP[i-1][j] for j in range(4))+mod
    DP[i][4]+=min(DP[i-1][j] for j in range(5))+A[i]

#print(DP)
print(min(DP[L-1]))


### FIXED CODE ###

L=int(input())
A=[int(input()) for i in range(L)]
su=sum(A)
#print(A)

DP=[[0 for i in range(5)] for j in range(L+1)]

mod=A[0]%2
if A[0]==0 :
    mod=2
DP[1]=[A[0],min(A[0],mod%2),min(A[0],mod%2,(mod+1)%2),min(A[0],mod%2,(mod+1)%2),min(A[0],mod%2,(mod+1)%2)]

for i in range(2,L+1):
    mod=A[i-1]%2
    if A[i-1]==0 :
        mod=2
    DP[i][0]+=DP[i-1][0]+A[i-1]
    DP[i][1]+=min(DP[i-1][0],DP[i-1][1])+mod
    DP[i][2]+=min(DP[i-1][j] for j in range(3))+(mod+1)%2
    DP[i][3]+=min(DP[i-1][j] for j in range(4))+mod
    DP[i][4]+=min(DP[i-1][j] for j in range(5))+A[i-1]

#print(DP)
print(min(DP[L]))
N,M = input().split()
A = input().split()
 
S = 0
for i in range(int(M)):
    S += int(A[ i - 1 ])

if int(N) - S >= 0:
    print(int(N) - S)
else:
    print("-1")

### FIXED CODE ###

R = input()

print( 2 * 3.141 * int(R) )
ans = 0

for i in range(len(s)):
    if s[i] == t[i]:
        ans+=1

print(ans)

### FIXED CODE ###

s = input()
t = input()

ans = 0

for i in range(len(s)):
    if s[i] == t[i]:
        ans+=1

print(ans)
n = int(input())
edges = {i: int(input())-1 for i in range(n)}
mem = [0 for _ in range(n)]
d = 0


def has_edge(edges, v, g, d):
    target = edges.get(v)
    if target is not None and mem[v] == 0:
        mem[v] = 1
        if target == g:
            return d
        else:
            return has_edge(edges, target, g, d+1)
    return -2


print(has_edge(edges, 0, 1, d)+1)


### FIXED CODE ###

n = int(input())
edges = {i: int(input())-1 for i in range(n)}


def push_buttom(v, goal):
    for i in range(n):
        v = edges[v]
        if v == goal:
            return i+1
    return -1


print(push_buttom(0, 1))
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
ans = sum(A)
A = Counter(A)
bc = [tuple(map(int, input().split())) for i in range(Q)]
for b, c in bc:
    v = A.pop(b, None)
    if v:
        A[c] += v
    	ans = ans+((c-b)*v)
    print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
ans = sum(A)
A = Counter(A)
bc = [tuple(map(int, input().split())) for i in range(Q)]
for b, c in bc:
    v = A.pop(b, None)
    if v:
        A[c] += v
        ans = ans+((c-b)*v)
    print(ans)
S = input().split()
print('A' + S[8] + 'C')


### FIXED CODE ###

S = input()
print('A' + S[8] + 'C')
r=map(int,input())
g=map(int,input())

print(2g-r)


### FIXED CODE ###

r=int(input())
g=int(input())

print(2*g-r)
import datetime as d
a,b = d.timedelta(seconds=int(input())).d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')


### FIXED CODE ###

import datetime as d
a,b = d.timedelta(seconds=int(input())),d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')
s = raw_input()

a = int(s[:2])
b = int(s[2:])

if 0<a<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if -1<b<13:
        print("YYMM")
    else:
        print("NA")


### FIXED CODE ###

s = input()
a = int(s[:2])
b = int(s[2:])

if 0<a<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 0<b<13:
        print("YYMM")
    else:
        print("NA")
import math
from decimal import Decimal


A, B = map(float, input().split())
answer = A * Decimal(B)

print(math.floor(answer))

### FIXED CODE ###

import math
from decimal import Decimal

A = input().split()
answer = Decimal(A[0]) * Decimal(A[1])

print(math.floor(answer))
from itertools import permutations

def hoge():
  N, M, R = map(int, input().split())
  r = map(int, input().split())
  r = [x - 1 for x in r]
  inf = float('inf')
  d = [[inf] * N for i in range(N)]

  for i in range(N):
      d[i][i] = 0

  for i in range(M):
      a, b, c = map(int, input().split())
      d[a-1][b-1] = c
      d[b-1][a-1] = c


  for k in range(N):
      for i in range(N):
          for j in range(N):
              t = d[i][k] + d[k][j]
              if d[i][j] > t:
                d[i][j] = t


  ans = inf
  for i in permutations(r):
      tmphoge = len(i) - 1
      temp = 0
      for j in range(tmphoge):
          temp += d[i[j]][i[j+1]]
          if temp > ans:
              break
      if ans > temp:
        ans = tmp
      # ans = min(ans, temp)

  print(ans)
hoge()


### FIXED CODE ###

from itertools import permutations

def input_list():
    return list(map(int, input().split()))

def main():
    n, m, r = input_list()
    rlist = input_list()
    rlist = [r-1 for r in rlist]
    d = [[float('inf')]*n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    
    for i in range(m):
        a, b, c = input_list()
        d[a-1][b-1] = c
        d[b-1][a-1] = c

    for k in range(n):
        for i in range(n):
            for j in range(n):
                distance = d[i][k]+d[k][j]
                if d[i][j] > distance:
                    d[i][j] = distance

    ans = float('inf')
    for p in permutations(rlist):
        distance = 0
        for i in range(r-1):
            distance += d[p[i]][p[i+1]]

        if ans > distance:
            ans = distance

    print(ans)

main()
n=int(input())
aa=map(int,input().split())
aa.sort()
d=0
for i in range(1,len(aa)):
  d+=abs(aa[i]-aa[i-1])
print(d)

### FIXED CODE ###

n=int(input())
aa=list(map(int,input().split()))
aa.sort()
d=0
for i in range(1,len(aa)):
  d+=abs(aa[i]-aa[i-1])
print(d)
n = input()
m = []
for i in range(n):
    m.append(input())

interest = [m[1]-m[0]]
for i in range(n):
    M = max(m[i+1:])
    if interest[-1] <M-m[i]:
        interest.append(M-m[i])
print(interest[-1])
 

### FIXED CODE ###

n = int(input())
a = [0 for i in range(n)]
for i in range(n):
    a[i] = int(input())
minimum = a[0]
profit = a[1]-a[0]

for i in range(1,n):
    if profit < a[i]- minimum:
        profit = a[i] - minimum
    if minimum > a[i]:
        minimum = a[i]
        
print(profit)
s = input()
n = (int(s)//2019) + 1
ans = 0
p = [0] * (n+1)
for i in range(n+1):
  p[i] = (2019 * i)

for j in p:
  ss = s
  while len(ss) > 0:
    idx = ss.find(str(j))
    if idx == -1:
      break
    else:
      ans += 1
      ss = ss[idx+1:]


print(ans)


### FIXED CODE ###

S = input()
S = S + '0'
mod = 2019
p = [0] * mod
r = 0
d = 1
for s in reversed(S):
  t = int(s)%mod
  r += t*d
  r %= mod
  d = d*10%mod
  p[r] += 1

print(sum([i*(i-1)//2 for i in p]))
n1 = input()
n2 = input()
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])

### FIXED CODE ###

n1 = int(input())
n2 = int(input())
choices = [1,2,3]
choices.remove(n1)
choices.remove(n2)
print(choices[0])
a,b=int(input().split())

if (a*b)%2==0:
    print("Even")

else:
    print("Odd")


### FIXED CODE ###

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

if (a*b)%2==0:
    print("Even")

else:
    print("Odd")
import math

#N = int(input())
N =int(input())
A =list(map(int, input().split())
        
#print(N)
cnt = 0
cur = A[0]
for i in range(1,N):
  if cur > A[i]:
    cnt += cur - A[i]
  else:
    cur = A[i]

print(cnt)

### FIXED CODE ###

import math

#N = int(input())
N =int(input())
A =list(map(int, input().split()))
cnt = 0
cur = A[0]
for i in range(1,N):
  if cur > A[i]:
    cnt += cur - A[i]
  else:
    cur = A[i]

print(cnt)
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)-1
for i in range(2,r):
    if a%i==0 & b%i==0:
        tar.append(i)
print(tar[-k])

### FIXED CODE ###

a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r+1):
    if a%i==0 and b%i==0:
        tar.append(i)
print(tar[-k])
r = 0

s = 3*r*r
printf(s)

### FIXED CODE ###

r = int(input())
print(3*r*r)
from math import *

def next_int():
    return int(input())

def next_ints():
    return list(map(int, input().split()))

a, b = next_ints()
n = gcd(a, b)
ans = 1
i = 2
while i*i <= n:
    if n%i == 0:
        ans += 1
        while n%i == 0:
            n //= i
    i += 1
if n != 1:
    ans += 1
print(int(ans), end="")


### FIXED CODE ###

# from math import *
from fractions import *

def next_int():
    return int(input())

def next_ints():
    return list(map(int, input().split()))

a, b = next_ints()
n = gcd(a, b)
ans = 1
i = 2
while i*i <= n:
    if n%i == 0:
        ans += 1
        while n%i == 0:
            n //= i
    i += 1
if n != 1:
    ans += 1
print(ans)
a, b = map(int, input().split())

left = max(b - a, 0)
if left == 0:
    print(1)
    exit(1)
print(left // a + 2)

### FIXED CODE ###

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

outlet = 1
res = 0

while outlet < b:
    outlet -= 1
    outlet += a
    res += 1

print(res)
import sys
N = int(input)

for i in range(len(N)):
    if N[i]==7:
        print('Yes')
        sys.exit()

print('No')

### FIXED CODE ###

N = input()
F = 0

for i in range(3):
    if N[i] == '7':
        F = F + 1

if F >= 1 :
    print('Yes')
else:
    print('No')
n= int(input())
 if n == 1:
        print("Hello World")
 else:
        a = int(input())+int(input())
        print(a)

### FIXED CODE ###

n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

table = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
a = [table[i] for i in A]

# ちょうどi本のマッチ棒を使って、条件を満たす整数を作るときの最大桁数
INF = float('inf')
dp = [-INF] * (N + 1)
dp[0] = 0
cost = set(a)

for i in range(1, N + 1):
    for j in cost:
        if i - j >= 0 and dp[i] < dp[i - j] + 1:
            dp[i] = dp[i - j] + 1

answer = []
for i in A[::-1]:
    while N:
        if dp[N] == dp[N - table[i]] + 1:
            answer.append(i)
            N -= table[i]
        else:
            break

print(''.join(map(str, answer)))

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)

table = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
a = [table[i] for i in A]

# ちょうどi本のマッチ棒を使って、条件を満たす整数を作るときの最大桁数
INF = float('inf')
dp = [-INF] * (N + 1)
dp[0] = 0
cost = set(a)

for i in range(1, N + 1):
    for j in cost:
        if i - j >= 0 and dp[i] < dp[i - j] + 1:
            dp[i] = dp[i - j] + 1

answer = []
for i in A:
    x = table[i]
    while N - x >= 0 and dp[N] == dp[N - x] + 1:
        answer.append(i)
        N -= x

print(''.join(map(str, answer)))
dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

input = "hoge"
flag = False
while input != "":
  input = raw_input()
  for i in xrange(len(input)):
    if input[i].lower() in dic:
      dic[input[i].lower()] += 1
    elif input[i] == ".":
      flag = True
      break
  if flag == True:
    break

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])

### FIXED CODE ###

import sys

dic = {}
for i in xrange(97, 123):
  dic.setdefault(chr(i), 0)

line = ""
while True:
  try:
    temp = raw_input()
    # print "temp = " + temp
    if temp != "":
      line += temp
    else:
      break
  except:
    break

# print line

for i in xrange(len(line)):
  try:
    if line[i].lower() in dic:
      dic[line[i].lower()] += 1
  except TypeError:
    continue

  # print dic
for i in xrange(97, 123):
  print chr(i) + " : " + str(dic[chr(i)])
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,M=map(int, input().split())

if N==1 and M==1:
    print(0)
    sys.exit()

if N==1 and M==2:
    print(2)
    sys.exit()

if N==2 and M==1:
    print(2)
    sys.exit()

if N==1:
    print(M-2)
    sys.exit()

if M==1:
    print(N-2)
    sys.exit()

print((N-2)*(M-2))

oo

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
N,M=map(int, input().split())

if N==1 and M==1:
    print(1)
    sys.exit()

if N==1:
    print(M-2)
    sys.exit()

if M==1:
    print(N-2)
    sys.exit()

print((N-2)*(M-2))
n,m,k=map(int,input().split())
if n%k==0 or m%k==0:
    print("Yes")
    exit()
for i in range(1,n+1):
    for j in range(1,m+1):
        if m*i+n*j-2*(i*j)==k:
            print("Yes")
            exit()
print("No")   

### FIXED CODE ###

n,m,k=map(int,input().split())
for i in range(n+1):
    for j in range(m+1):
        if m*i+n*j-2*(i*j)==k:
            print("Yes")
            exit()
print("No")
x,y,z = map(int,inout().split())
print(str(z)+' '+str(x) + ' ' + str(y))

### FIXED CODE ###

x,y,z = map(int,input().split())
print(str(z)+' '+str(x) + ' ' + str(y))
a,b=map(int,input().split())

if a-2b > 0:
  print(a-2b)
else:
  print(0)

### FIXED CODE ###

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

if a-2*b>0:
  print(a-2*b)
else:
  print(0)
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d < 30):
     	print("Heisei")
	else:
    	print("TBD")
else:
    print("TBD")

### FIXED CODE ###

y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d <= 30):
		print("Heisei")
	else:
		print("TBD")
else:
	print("TBD")
while True:
	w, h = map(int, raw_input().split())
	if h == 0 and w == 0: break
	for y in range(h):
		out = ""
		for x in range(w):
			out += "#"
		print out
	print ""

### FIXED CODE ###

n = raw_input()
arrry  = raw_input().split()
numList = reversed(arrry)
for n in numList:
	print n,
print
N = int(input())
W = map(int, input().split())

def calc_sum(W, T):
  S1 = sum(W[:T])
  S2 = sum(W[T:])
  return S1, S2

def calc_abs(S1, S2):
  return abs(S1-S2)
  
min_ = 1000
for i in range(len(W)):
  S1, S1 = calc_sum(W, i)
  j = calc_abs(S1, S2)
  if j < min_:
    min_ = j
    
print(min_)

### FIXED CODE ###

N = int(input())
W = list(map(int, input().split()))
 
def calc_sum(W, T):
  S1 = sum(W[:T])
  S2 = sum(W[T:])
  return S1, S2
 
def calc_abs(S1, S2):
  return abs(S1-S2)
  
min_ = 1000
for i in range(len(W)):
  S1, S2 = calc_sum(W, i)
  j = calc_abs(S1, S2)
  if j < min_:
    min_ = j
    
print(min_)
n, k = map(int, input().split())

a = 1
for i in range(k, n + 1):
  mmin = summ(i)
  mmax = summ(n, n - i)
  m = mmax - mmin
  a += m

print(a)

def summ(n, nn=0):
  nn = max(nn, 0)
  return n*(n+1)/2 - nn*(nn+1)/2


### FIXED CODE ###

def summ(n, nn=0):
  nn = max(nn, 0)
  return n*(n+1)/2 - nn*(nn+1)/2

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

a = 1
for i in range(k, n + 1):
  mmin = summ(i - 1)
  mmax = summ(n, n - i)
  m = mmax - mmin + 1
  a += m

k = 10**9 + 7
print(int(a%k))
n = int(input())n = int(input())
n -= 1
ans = []
for i in range(100):
  if n >= 26:
    n -= 26
    ans.append(chr(n%26+97))
    n //= 26
ans.append(chr(n+97))
print(*ans[::-1],sep="")

### FIXED CODE ###

n = int(input())
n -= 1
ans = []
for i in range(100):
  if n >= 26:
    n -= 26
    ans.append(chr(n%26+97))
    n //= 26
ans.append(chr(n+97))
ans = ans[::-1]
print(*ans,sep="")
s,t = input().split
print(s + t)

### FIXED CODE ###

s,t = input().split()
ans = t + s
print(ans)
n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        t = 0
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000) 

n = int(input())
high = list(map(int,input().split()))
lists = []

def func(i,t):
    if i == n - 1:
        lists.append(t)
        return
    if high[i] < high[i+1]:
        lists.append(t)
        func(i+1,0)
    else:
        t += 1
        func(i+1,t)

func(0,0)
print(max(lists))
if len(sed(list(input())))<=2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
if len(set(s[1:]))==1 or len(set(s[:-1]))==1:
  print('Yes')
else:
  print('No')
l, r = list(map(int, input().split()))
     
    ans = 2018
     
    for i in range(l, r + 1):
      for j in range(i + 1, r + 1):
        if ((i * j) % 2019) < ans:
          ans = (i * j) % 2019
        if ans == 0:
          print(ans)
          exit()
     
    print(ans)

### FIXED CODE ###

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

ans = 3000

for i in range(l, r):
  for j in range(i + 1, r + 1):
    if (i * j) % 2019 < ans:
      ans = (i * j) % 2019
    if ans == 0:
      print(ans)
      exit() 
print(ans)
N = int(input())

point = []
dist = []

for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    dist.append(abs(x) + abs(y))

maxDist = dist[0]
mask = maxDist % 2

for i in range(1, N) :
    if dist[i] % 2 != mask :
        break
    maxDist = max(maxDist, dist[i])
else :  # 実現可能
    print(maxDist) # 腕の数
    out = [1] * maxDist
    print(*out)

    for i, (x, y) in enumerate(point) :
        # if x < 0 :
        #     holizon = ['L'] * abs(x)
        # elif x > 0 :
        #     holizon = ['R'] * abs(x)
        # else :
        #     holizon = ['']

        # if y < 0 :
        #     vertical = ['D'] * abs(y)
        # elif y > 0 :
        #     vertical = ['U'] * abs(y)
        # else :
        #     vertical = ['']

        # R = (maxDist - dist[i]) // 2
        # if R > 0 :
        #     last = ['LR'] * R
        # else :
        #     last = ['']
        holizon = ['']
        vertical = ['']
        last = ['']
        print(''.join(holizon + vertical + last))



### FIXED CODE ###

N=int(input())

point = []
parity = {}
for _ in range(N) :
    x, y = map(int, input().split())
    point.append((x, y))
    parity[(x + y) % 2] = 1

if len(set(parity)) == 2 :
    print('-1')
else :
    m = 38
    parity = 1 if (1 in parity) else 0
    print(m + 1 - parity)
    if parity == 1 :  # 距離が奇数
        print(*[1 << i for i in range(m)])
    else :
        print(1, *[1 << i for i in range(m)])

    def arm(x, y, m) :
        if abs(x) >= abs(y) :
            if x >= 0 :
                return ('R', x - (1<<m), y)
            else :
                return ('L', x + (1<<m), y)
        else :
            if y >= 0 :
                return ('U', x, y - (1<<m))
            else :
                return ('D', x, y + (1<<m))

    for x, y in point :
        ans = []
        for i in range(m-1, -1, -1) :
            mode, x, y = arm(x, y, i)
            ans.append(mode)
        if parity == 0 :  # 偶数の場合一つ足す
            if x == 1 :
                ans.append('R')
            elif x == -1 :
                ans.append('L')
            elif y == 1 :
                ans.append('U')
            elif y == -1 :
                ans.append('D')
        print(''.join(ans[::-1]))
S = input()
ans =0
for i in (len(S)-1):
  if (S[i] == "A") and (S[i+1] =="C"):
    ans = 1
if ans == 1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()


ans =0
for i in range((len(S)-1)):
  if (S[i] == "A") and (S[i+1] =="C"):
    ans = 1
if ans == 1:
  print("Yes")
else:
  print("No")
n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n-k+1):
  ans = min(ans, h[i:i+k][-1] - a[i:i+k][0])
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
h = [int(input()) for i in range(n)]
h.sort()
ans = 10 ** 10
for i in range(n-k+1):
  ans = min(ans, h[i+k-1] - h[i])
print(ans)
n= int(input())
s= list(input())
t= list(input())

ans= ""
for i in range(n):
    ans=ans+s[i]+t[i]

print(ans)

### FIXED CODE ###

a= int(input())
b= int(input())
c= 6
print(c-(a+b))
print(list(map(int,input().split()).index(0))


### FIXED CODE ###

print(list(map(int,input().split())).index(0) + 1)
n,m = int(input().split())
print((n*(n-1))//2 + (m*(m-1))//2)

### FIXED CODE ###

n,m = map(int,input().split())
print((n*(n-1))//2 + (m*(m-1))//2)
def main():
    S = list(input())
    k = 0
    ans = False
    while True :
        if k >= len(S):
            ans = True
            break
        elif S[k] + S[ k + 1] != "hi":
            break
        else :
            k += 2
    if ans : print("Yes")
    else: print("No")
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    S = list(input())
    k = 0
    ans = False
    
    while True :
        if len(S) % 2 != 0 :
            break 
        elif k == len(S):
            ans = True
            break
        elif S[k] + S[ k + 1] != "hi":
            break
        else :
            k += 2
    if ans : print("Yes")
    else: print("No")
if __name__ == '__main__':
    main()
n = input().replace(' ', '')
m = int(n ** 0.5 + 1e-6)
print('Yes' if n == m * m else 'No')

### FIXED CODE ###

n = int(input().replace(' ', ''))
m = int(n ** 0.5 + 1e-6)
print('Yes' if n == m * m else 'No')