Harryxun/stf_run huggingface dataset:
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

MODN = (10 ** 9) + 7

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

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


INF = 10 ** 10


# K個の青ボールとN-K個の赤ボール
# 同じ色のボールは区別可能
N, K = [int(x) for x in stdin.readline().rstrip().split()]
#num = [i for i in range(N)]

blue_num = K
red_num = N - K

# 1<=i<=K を満たすiそれぞれについて答えを計算し、MODNで割った余りを答える

for i in range(1, K+1):
    if i == 1:
        ans = (red_num+1) % MODN
        print(ans)
    else:
        cand_space = K - 1
        first_set_red_num = i - 1
        if cand_space >= first_set_red_num:
            c_num = combinations_count(cand_space, first_set_red_num) % MODN
            remind_red_num = red_num - first_set_red_num
            cand_space2 = first_set_red_num + 2

            if cand_space2 > remind_red_num:
                c_num2 = ((cand_space2 ** remind_red_num) // math.factorial(remind_red_num)) % MODN
                ans = c_num * c_num2
                ans = ans % MODN
            else:
                #if remind_red_num < cand_space2:
                #ans = c_num * ((first_set_red_num+2) ** remind_red_num)
                c_num2 = combinations_count(remind_red_num+1, first_set_red_num+2-1) % MODN
                ans = c_num * c_num2
                ans = ans % MODN
            print(ans)


### FIXED CODE ###

from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

MOD = (10 ** 9) + 7

INF = 10 ** 10

MAX = 510000

def com_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD


def com(n, k):
    if n < k:
        return 0
    if (n < 0) or (k < 0):
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


if __name__ == "__main__":
    # K個の青ボールとN-K個の赤ボール
    # 同じ色のボールは区別可能
    N, K = [int(x) for x in stdin.readline().rstrip().split()]
    
    fac = [0] * MAX
    finv = [0] * MAX
    inv = [0] * MAX

    com_init()

    for i in range(1, K+1):
        ans = com(N-K+1, i) * com(K-1, i-1) % MOD
        print(ans)
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int R;
 
  cout << R * π << endl;　
  
}


### FIXED CODE ###

import math

pi = math.pi

R = int(input())

print(2 * R * pi)
A = list(map(int, input().split()))

A.sort(reverse=True)

print(A[0]-A[2])

### FIXED CODE ###

K = int(input())

even = (K//2)
odd = K-(even)

print(odd*even)
import sys
input_lines = [[int(i) for i in line.split()] for line in sys.stdin.read().splitlines()]
[user_num, rel_num] = input_lines[0]
rel_list = input_lines[1:rel_num+1]
ques_num = input_lines[rel_num+1][0]
ques_list = input_lines[rel_num+2:]
color_list = [-1] * user_num
adja_list = [set() for i in range(user_num)]

def dfs(id, color):
    if color_list[id] == -1:
        color_list[id] = color
        for a_id in adja_list[id]:
            dfs(a_id, color)



for rel in rel_list:
    adja_list[rel[0]].add(rel[1])
    adja_list[rel[1]].add(rel[0])

color = 0
for id in range(user_num):
    dfs(id, color)
    color += 1

for ques in ques_list:
    if color_list[ques[0]] == color_list[ques[1]]:
        print('yes')
    else:
        print('no')



### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
input_lines = [[int(i) for i in line.split()] for line in sys.stdin.read().splitlines()]
[user_num, rel_num] = input_lines[0]
rel_list = input_lines[1:rel_num+1]
ques_num = input_lines[rel_num+1][0]
ques_list = input_lines[rel_num+2:]
color_list = [-1] * user_num
adja_list = [set() for i in range(user_num)]

def dfs(id, color):
    if color_list[id] == -1:
        color_list[id] = color
        for a_id in adja_list[id]:
            dfs(a_id, color)



for rel in rel_list:
    adja_list[rel[0]].add(rel[1])
    adja_list[rel[1]].add(rel[0])

color = 0
for id in range(user_num):
    dfs(id, color)
    color += 1

for ques in ques_list:
    if color_list[ques[0]] == color_list[ques[1]]:
        print('yes')
    else:
        print('no')
s = input().split()
n = int(s[3])
l1=[1]*int(s[0])
l2=[0]*int(s[1])
l3=[-1]*int(s[2])
l=l1+l2+l3
sum_=0
i=0
while i < n:
    sum_+=l[i]

    i += 1
print(sum_)

### FIXED CODE ###

s = input().split()
n = int(s[3])
sum_=0
if int(s[0]) >= n:
    sum_=1*n
elif int(s[0])+int(s[1]) >= n:
    sum_=1*(n-int(s[1]))
elif int(s[0])+int(s[1])+int(s[2]) >= n:
    sum_=1*int(s[0])+(-1*(n-int(s[0])-int(s[1])))

print(sum_)
f = True
cnt = 0
l = [0,0,0]
while f:
    t = []
    t.append(int(input()))
    t.append(int(input()))
    t.append(int(input()))
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        continue
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),s for s in l)
    


### FIXED CODE ###

f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        break
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[1],l[0],l[2])
s = raw_input()
arr=["sunny","cloudy","rainy"]
n=arr.index(s)
print arr[(n+1)%len(arr)]

### FIXED CODE ###

s = raw_input()
arr=["Sunny","Cloudy","Rainy"]
n=arr.index(s)
print arr[(n+1)%len(arr)]
a = int(input())
b = int(input())
c = int(input())

count = 0
n = 0

while b-a==0:
   if c%(b-(a+n)==0
      count += 1 
      n += 1
   else:
      n += 1


### FIXED CODE ###

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

count = 0

for i in range(a, b+1):
   if c % i == 0:
      count += 1

print(count)
H = int(input())

i=1
while True:
    A=2**i
    if H==A:
        jo=i
        break
        
    elif H<A:
        jo=i-1
        break
    i+=1

for j in range(0,jo+1):
    result=result+2**j
print(result)

### FIXED CODE ###

H = int(input())

#Hは２のjo乗より小さい
i=1
while True:
    A=2**i
    if H==A:
        jo=i
        break
        
    elif H<A:
        jo=i-1
        break
    i+=1

result=0
for j in range(0,jo+1):
    result=result+2**j
print(result)
N = int(input())
if K%2==0:
    print(K//2*(K//2-1))
else:
    print(-(-K//2)*(K-1)//2)

### FIXED CODE ###

N=int(input())
if N%2==0:
  print((N//2)**2)
elif N%2!=0:
  print((N//2)*(N-(N//2)))
import math
num = 100000
s = set([i for i in range(2,num+1)])
p = set()
mi = 0
while mi<=math.sqrt(num):
    mi = min(s)
    t = set([i*mi for i in range(1,num//mi+1)])
    p.add(mi)
    s-=t
p = p|s
p2 = set([i for i in p if (i+1)//2 in p])

q = int(input())
for i in range(q):
    l , r = map(int, input().split())
    s2 = set([i for i in range(l,r+1)if in p2])
    print(len(s2))


### FIXED CODE ###

import math
num = 100000
s = set([i for i in range(2,num+1)])
p = set()
mi = 0
while mi<=math.sqrt(num):
    mi = min(s)
    t = set([i*mi for i in range(1,num//mi+1)])
    p.add(mi)
    s-=t
p = p|s
p2 = set([i for i in p if (i+1)//2 in p])
c = 0
x = [0]*100001
for i in range(1,num+1):
    if i in p2:
        c+=1
    x[i]=c

q = int(input())
for i in range(q):
    l , r = map(int, input().split())
    ans = x[r]-x[l-1]
    print(ans)
K = int(input())
a = 0
b = 0

for i in range(1, 51):
	if (K - K % i) / i + i - 1 >= 1000 + 10**16:
		break

	b = int(K % i)
	a = int((K - b) / i)
	N = i
	


list = [0] * N
j = 0


print(a, b, N)


while (j <= N - b - 1) :
	list[j] = N + a - b - 1
	j += 1

while (j > N - b - 1 and j <= N - 1):
	list[j] = 2 * N - b
	j += 1


list = map(str, list)
print(' '.join(list))

### FIXED CODE ###

K = int(input())

b = K % 50
a = K // 50
	
list = [0] * 50
j = 0

while (j <= 49 - b) :
	list[j] = 49 + a - b
	j += 1

while (j <= 49):
	list[j] = 2 * 50 + a - b
	j += 1

list = map(str, list)
print('50')
print(' '.join(list))
a,b,c,k = map(int,input().split())
if k <= a+b:print(a)
else: print(a-(k-a-b))

### FIXED CODE ###

S = input()
T = input()
if T[:len(T)-1] == S:
    print('Yes')
else:
    print('No')
N = int(input())
if N == 1:
  print("Hello World")
  exit()
else:
  A, B = map(int, input().split())
  print(A + B)


### FIXED CODE ###

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

ans = 0

while b > 0:
	if b - ( a - 1 ) > a:
    	b -= a - 1
        ans += 1
    else:
        b -= a
        ans += 1

print(ans)

### FIXED CODE ###

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

ans = 0
out = 1

while out < b:
    out -= 1
    out += a
    ans += 1

print(ans)
n = int(input())
arr = {input() for _ in range(n)}
dic={}

#各単語の出現回数を数える
for i in range(n):
    if arr[i] not in dic:
        dic[arr[i]] = 1
    else:
        dic[arr[i]] += 1
#最大の出現回数を求める
largest = max(dic.values())
ans = []

for keys in dic.keys():
    if dic[keys] == largest:
        ans.append(keys)
#単語を辞書順に並べ替えて出力する
ans = sorted(ans)

for words in ans:
    print(words)

### FIXED CODE ###

n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)
x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            ans[a*100+b*101+c*102+d*103+e*104+f*105]=1
            
print(ans[x])
            


### FIXED CODE ###

x=int(input())
if x>=2100:
  print(1)
  exit()

ans=[0]*2100
for a in range(22):
  for b in range(22):
    for c in range(22):
      for d in range(22):
        for e in range(22):
          for f in range(21):
            y=a*100+b*101+c*102+d*103+e*104+f*105
            if y<=2099:
              ans[y]=1
            
print(ans[x])
import bisect

N = int(input())
S = list(str(input()))

def ordN(x):
  return ord(x) - ord('a')

li = [[] for _ in range(26)]
for i,s in enumerate(S):
  li[ordN(s)].append(i)

for i in range(int(input())):
  Q1, Q2, Q3 = input().split()
  if Q1 == "1":
    Q2 = int(Q2) - 1
    if S[Q2] != Q3:
      I = bisect.bisect(li[ordN(S[Q2])], Q2)
      li[ordN(S[Q2])].pop(I)
      bisect.insort(li[ordN(Q3)], Q2)
      S[Q2] = Q3
  else:
    Q2, Q3 = int(Q2)-1, int(Q3)-1
    count = 0
    for j in range(26):
      I = bisect.bisect_left(li[j], Q2)
      if I < len(li[j]) and li[j][I] <= Q3:
        count += 1
    print(count)

### FIXED CODE ###

import bisect

N = int(input())
S = list(str(input()))

def ordN(x):
  return ord(x) - ord('a')

li = [[] for _ in range(26)]
for i,s in enumerate(S):
  li[ordN(s)].append(i)

for i in range(int(input())):
  Q1, Q2, Q3 = input().split()
  if Q1 == "1":
    Q2 = int(Q2) - 1
    if S[Q2] != Q3:
      I = bisect.bisect_left(li[ordN(S[Q2])], Q2)
      li[ordN(S[Q2])].pop(I)
      bisect.insort(li[ordN(Q3)], Q2)
      S[Q2] = Q3
  else:
    Q2, Q3 = int(Q2)-1, int(Q3)-1
    count = 0
    for j in range(26):
      I = bisect.bisect_left(li[j], Q2)
      if I < len(li[j]) and li[j][I] <= Q3:
        count += 1
    print(count)
N, R = [int(x) for x in input()]

if N > 9:
  print(R)
else:
  print(R - 100 * (10 - N))


### FIXED CODE ###

N, R = [int(x) for x in input().split(' ')]

if N > 9:
  print(R)
else:
  print(R + 100 * (10 - N))
n=int(input())
kei = 0.0
for i in range (n):
    x,u=list(map(input().split()))
    if u[i]=='JPY':
        kei += float(int(x[i]))
    else:
        kei += float(x[i])*380000
print(kei)


### FIXED CODE ###

n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)
X = int(input())
i = int(n**0.5)

while i >= 2:
    if X % i == 0:
        X += 1
        i = int(X**0.5)
    else:
        i -= 1
        
print(X)

### FIXED CODE ###

X = int(input())
i = int(X**0.5)

while i >= 2:
    if X % i == 0:
        X += 1
        i = int(X**0.5)
    else:
        i -= 1
        
print(X)
import numpy as np
L,R = map(int,input().split())
ans = L*(L+1)%2019

np1 = np.array(range(L,R+1))
np2 = np.multiply.outer(np1,np1)
np3 = np2%2019
np3[0,0] = 2019
np3[R-L-1,R-L-1]=2019
print(np.amin(np3))

### FIXED CODE ###

L,R = map(int,input().split())
ans = (L*(L+1))%2019
if R-L >= 2019:
    print(0)
    exit()
else:
    for i in range(L,R):
        for j in range(L+1,R+1):
            if ans > (i*j)%2019:
                ans = (i*j)%2019
print(ans)
A = input()
B = input()

ans = ['1', '2', '3']

for i in range(len(ans)):
  if ans[i] == A or ans[i] = B:
    del ans[i]
    
print(nas[0])

### FIXED CODE ###

A = int(input())
B = int(input())
print(6 - A - B)
if input().isupeer == True:
  ans = "A"
else:
  ans = "a"
  
print(ans)

### FIXED CODE ###

if input().isupper():
  print("A")
else:
  print("a")
T=[]
for i in range(5):
    T.append(int(input()))
A=list(map(lambda x:x%10,T))
S=list(map(lambda y:y//10,T))
count=0
B=[]
for j in range(5):
    if A[j]!=0:
        count+=1
        B.append(A[j])
print(10*(sum(S)+count-1)+min(B))


### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
T=[a,b,c,d,e]
A=list(map(lambda x:x%10,T))
S=list(map(lambda y:y//10,T))
count=0
B=[]
for j in range(5):
    if A[j]!=0:
        count+=1
        B.append(A[j])
if len(B)==0:
    print(10*(sum(S)+count))
else:
    print(10*(sum(S)+count-1)+min(B))
x = input()
if int(x[0]) + int(x[2]) + int(x[4]) >=22 ;
 print('bust')
else;
 print('win')

### FIXED CODE ###

x = input()
x = x.split()
if int(x[0]) + int(x[1]) + int(x[2]) >=22:
 print('bust')
else:
 print('win')
ans = 5
cnt = 0
N = int(input())
for i in range(5):
    c = int(input())
    if N < c:
        continue
    else:
        if i == 0:
            ans += N // c
            minn = c
        else:
            if minn - c > 0:
                cnt += 1
                minn = c
for i in range(cnt):
    ans += 2 ** i
print(ans)

### FIXED CODE ###

import math
C = []
N = int(input())
for i in range(5):
    c = int(input())
    C.append(c)
print(math.ceil(N / min(C)) + 4)
r, D, x = map(int, input().split())
 
for i in range(10):
    x = r * x - D
    print(x)

### FIXED CODE ###

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

if A < 6:
    print(0)
elif 6 <= A <13:
    print(B//2)
else:
    print(B)
N, K = map(int, input().split())
A = list(map(int, input().split()))

def isOk(x):
    cnt = 0
    for a in A:
        cnt += a // x
    return cnt <= K

ok = max(A)
ng = 0
for _ in range(50):
    mid = (ok + ng) // 2
    if isOk(mid):
        ok = mid
    else:
        ng = mid

print(ok)


### FIXED CODE ###

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

def isOk(x):
    cnt = 0
    for a in A:
        cnt += (a - 1) // x
    return cnt <= K

ok = max(A)
ng = 0
while ok - ng > 1:
    mid = (ok + ng) // 2
    if isOk(mid):
        ok = mid
    else:
        ng = mid

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

def lcm(a, b):
    return (a * b) // gcd(a,  b)

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return  lcm_list(li)

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


i = lcm_list(a) -1
print(sum([i%j for j in a]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(30000)

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

def lcm(a, b):
    return (a * b) // gcd(a, b)

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])

    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return lcm_list(li)

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


i = max(lcm_list(a) - 1, 1)
print(sum([i % j for j in a]))
import math
def check1(N):
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    n = int(math.log10(N))
    summ = 0
    if n >= 3:
        for i in range(2, n):
            summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()

### FIXED CODE ###

import math
def check1(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    summ = 0
    if n >= 3:
        for i in range(n):
            summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()
import numpy as np

n, h = map(int, input().split())
a = 0
b = []
for i in range(n):
    A, B = map(int, input().split())
    a = max(a, A)
    b.append(B)
b = np.array(b, dtype=np.int64)
b = np.sort(b[b > a])[::-1]

if b.sum() >= h:
    cnt = 0
    for i in b:
        h -= b
        cnt += 1
        if h < 0:
            print(cnt)
            exit()

print((h - b.sum() + a - 1) // a + len(b))

### FIXED CODE ###

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

a = 0
b = []
for i in range(n):
    A, B = map(int, input().split())
    a = max(a, A)
    b.append(B)
b = sorted([i for i in b if a < i], reverse=True)

cnt = 0
for i in b:
    cnt += 1
    h -= i
    if h <= 0:
        print(cnt)
        exit()
print(cnt + (h + a - 1) // a)
N, K = map(int, input().split())
A = list(map(int, input().split()))

ng = 0
ok = max(a)

while ok - ng > 1:
    cnt = 0
    l = (ok + ng) // 2
    for a in A:
        cnt += (a // l) + (a % l != 0) - 1

    if cnt <= k:
        ok = l
    else:
        ng = l
print(ok)

### FIXED CODE ###

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

ng = 0
ok = max(A)

while ok - ng > 1:
    cnt = 0
    l = (ok + ng) // 2
    for a in A:
        cnt += (a // l) + (a % l != 0) - 1

    if cnt <= K:
        ok = l
    else:
        ng = l
print(ok)
a = input()
b = input()
x = int(max(b))-int(min(b))
print(x)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort()
print(abs(A[0]-A[-1]))
n, x = map(int, input().split())
l =list(map(int, input().split()))
d = [0]
for i in range(n+1):
    d.append(d[i]+l[i])
ans = 0
for i in range(n+1):
    if d[i] <= x:
        ans += 1
print(ans)

### FIXED CODE ###

n, x = map(int, input().split())
l =list(map(int, input().split()))
d = [0]
for i in range(n):
    d.append(d[i]+l[i])
ans = 0
for i in range(n+1):
    if d[i] <= x:
        ans += 1
print(ans)
import sys, math, itertools, collections, bisect, heapq
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
dydx4 = ((-1,0),(0,-1),(0,1),(1,0))
def check(i,j):
  return 0 <= i < h and 0 <= j < w 
def on_block(i,j):
  return S[i][j] == "#"
h,w = map(int,input().split())
ci,cj = map(int,input().split())
ci-=1;cj-=1
gi,gj = map(int,input().split())
gi-=1;gj-=1
S = [list(input()) for i in range(w)]
grid = [[inf] * w for i in range(h)]
grid[ci][cj] = 0
que = []
que.append((0,ci,cj))
while que:
  now,si,sj = heapq.heappop(que)
  if now > grid[si][sj]:continue
  for di,dj in dydx4:
    ni = si + di
    nj = sj + dj
    if not check(ni,nj):continue
    if on_block(ni,nj): continue
    else:
      if now < grid[ni][nj] :
        grid[ni][nj] = now
        heapq.heappush(que,(now,ni,nj))
  for i in range(si-2,si+3):
    for j in range(sj-2,sj+3):
      if not check(i,j):continue
      if on_block(i,j):continue
      else:
        if now + 1 < grid[i][j] :
          grid[i][j] = now + 1
          heapq.heappush(que,(now+1,i,j))
print(grid[gi][gj] if grid[gi][gj] != inf else -1)
# print(*grid,sep = "\n")

### FIXED CODE ###

import sys, math, itertools, collections, bisect, heapq
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1
dydx4 = ((-1,0),(0,-1),(0,1),(1,0))
def check(i,j):
  return 0 <= i < h and 0 <= j < w 
def on_block(i,j):
  return S[i][j] == "#"
h,w = map(int,input().split())
ci,cj = map(int,input().split())
ci-=1;cj-=1
gi,gj = map(int,input().split())
gi-=1;gj-=1
S = [list(input()) for i in range(h)]
grid = [[inf] * w for i in range(h)]
grid[ci][cj] = 0
que = collections.deque()
que.append((0,ci,cj))
while que:
  now,si,sj = que.popleft()
  if now > grid[si][sj]:continue
  for di,dj in dydx4:
    ni = si + di
    nj = sj + dj
    if not check(ni,nj):continue
    if on_block(ni,nj): continue
    else:
      if now < grid[ni][nj] :
        grid[ni][nj] = now
        que.appendleft((now,ni,nj))
        # heapq.heappush(que,(now,ni,nj))
  for i in range(si-2,si+3):
    for j in range(sj-2,sj+3):
      if not check(i,j):continue
      if on_block(i,j):continue
      else:
        if now + 1 < grid[i][j] :
          grid[i][j] = now + 1
          que.append((now+1,i,j))
          # heapq.heappush(que,(now+1,i,j))
print(grid[gi][gj] if grid[gi][gj] != inf else -1)
# print(*grid,sep = "\n")
from bisect import bisect_left
n = int(input())
A=[int(input()) for _ in range(n)]
row = [A[0]]
for a in A[1:]:
    if a<=row[-1]:
        row.append(a)
    else:
        row[len(row) - bisect_left(row[::-1],a)] = a
print(len(row))

### FIXED CODE ###

r = int(input())
print(3*(r**2))
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    c = input()
    an = [a,i,u,e,o]
    
    if c in an:
        print("vowel")
    else:
        print("consonant")
    
if __name__ == "__main__":
	main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    c = input()
    an = ["a","i","u","e","o"]
    
    if c in an:
        print("vowel")
    else:
        print("consonant")
    
if __name__ == "__main__":
	main()