Harryxun/stf_run huggingface dataset:
c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a=b=c=d=e=f:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

c1 = list(map(int,input().split()))
c2 = list(map(int,input().split()))
c3 = list(map(int,input().split()))
a = c1[0]+c2[1]+c3[2]
b = c1[1]+c2[2]+c3[0]
c = c1[2]+c2[0]+c3[1]
d = c1[0]+c2[2]+c3[1]
e = c1[1]+c2[0]+c3[2]
f = c1[2]+c2[1]+c3[0]
if a==b==c==d==e==f:
  print('Yes')
else:
  print('No')
N = int(input())
A = [0]*N

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

for i in range(N):
  ans = max(A[0:i].extend(A[i+1:N]))
  print(ans)


### FIXED CODE ###

N = int(input())
A = [0]*N

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

As = sorted(A, reverse=True)
M = As[0]
Ms = As[1]

for i in range(N):
  if M == A[i]:
    print(Ms)
  else:
    print(M)
r = int(input())
area = r**2 * 3.14
enshuu = r * 2 * 3.14
print(area, enshuu)

### FIXED CODE ###

r = float(input())
area = r**2 * 3.141592653589
enshuu = r * 2 * 3.141592653589
print("{0:.6f} {1:.6f}".format(area, enshuu))
n = int(input())
k = int(input())
x = 0
y =0
sum = 0
for i in range(n):
    x=int(input())
    y = int(input())
    sum+=y
    if(k <= sum):
        print(x)
        break

### FIXED CODE ###

x = raw_input().split(" ")
num_operations = int(x[0])
kth_integer = int(x[1])
field = {}
for p in range(0, num_operations):
 line = raw_input().split(" ")
 a = int(line[0])
 b = int(line[1])
 if a in field:
  field[a] += b
 else:
  field[a] = b
ks = field.keys()
ks.sort()
out = field.keys()[-1]
for k in ks:
 kth_integer -= field[k]
 if (kth_integer <= 0):
  out = k
  break
print (out)
a = list(map(int,input().split()))
a.sort()

print(ans(a[3]-a[1]))


### FIXED CODE ###


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

print(abs(a[2]-a[0]))
# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""

import queue

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

    connedted_room_list = [ [] for i in range(M)]
    for i in range(M):
        A, B = map(int, input().split())
        connedted_room_list[A-1].append(B-1)
        connedted_room_list[B-1].append(A-1)

    answer_list = [ -1 for i in range(N)]
    answer_list[0] = 0

    next_rooms_queue = queue.Queue()
    next_rooms_queue.put(0)
    now_room = int()
    while not next_rooms_queue.empty():
        now_room = next_rooms_queue.get()
        for i in connedted_room_list[now_room]:
            if answer_list[i] == -1:
                answer_list[i] = now_room
                next_rooms_queue.put(i)

    is_escapable = True
    for i in range(1, N):
        if answer_list[i] == -1:
            is_escapable = False
            break
    
    if is_escapable:
        print("Yes")
        for i in range(1, N):
            print(answer_list[i]+1)
    else:
        print("No")

if __name__ == "__main__":
    main()




### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
@author: H_Hoshigi
"""

import queue

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

    connedted_room_list = [ [] for i in range(N)] # ここでNとMを書き間違えていた。
    for i in range(M):
        A, B = map(int, input().split())
        connedted_room_list[A-1].append(B-1)
        connedted_room_list[B-1].append(A-1)

    answer_list = [ -1 for i in range(N)]
    answer_list[0] = 0

    next_rooms_queue = queue.Queue()
    next_rooms_queue.put(0)
    now_room = int()
    while not next_rooms_queue.empty():
        now_room = next_rooms_queue.get()
        for i in connedted_room_list[now_room]:
            if answer_list[i] == -1:
                answer_list[i] = now_room
                next_rooms_queue.put(i)

    
    is_escapable = True
    for i in range(1, N):
        if answer_list[i] == -1:
            is_escapable = False
            break

    if is_escapable:
        print("Yes")
        for i in range(1, N):
            print(answer_list[i]+1)
    else:
        print("No")

if __name__ == "__main__":
    main()
from sys import stdin
S = stdin.readline().rstrip()
n = len(S)
def dfs(i, f):
    if i = n-1:
        return sum(list(map(int, f.split('+'))))
    return dfs(i+1, f + S[i + 1]) + dfs(i + 1, f + '+' s[i-1])
#最初が＋なし、次が＋あり
print(dfs(0, S[0]))


### FIXED CODE ###

from sys import stdin
S = stdin.readline().rstrip()
n = len(S)
def dfs(i, f):
    if i == n-1:
        return sum(list(map(int, f.split('+'))))
    return dfs(i+1, f + S[i + 1]) + dfs(i + 1, f + '+' + S[i+1])
print(dfs(0, S[0]))
L,R=map(int, input().split())
if R//2019-L//2019>0:
  print(((2019//L*2019)*((2019//L*2019)+1))%2019)
else:
  print((L*(L+1))%2019)

### FIXED CODE ###

L, R = map(int, input().split())
if R-L >= 2018:
    print(0)
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            ans = min(ans, i*j % 2019)
    
    print(ans)
import sys
input = sys.stdin.readline
p,q,r = map(int,input().split())
print(min[p+q,q+r,r+p])


### FIXED CODE ###

import sys
input = sys.stdin.readline
p,q,r = map(int,input().split())
print(min(p+q,q+r,r+p))
#include <bits/stdc++.h>
using namespace std;

int main()
{
  int n;
  bool ans = 1;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++)
    cin >> vec[i];
  sort(vec.begin(), vec.end());

  for (int i = 0; i < n - 1; i++)
  {
    if (vec[i] == vec[i + 1])
    {
      ans = 0;
      break;
    }
  }
  if (ans)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

### FIXED CODE ###

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

if (len(set(A)) == len(A)):
  print("YES")
else:
  print("NO")
s=input()
a=s[0]
z=s[-1]
s=[1:-1]
print(a+str(len(s))+z)

### FIXED CODE ###

s=input()
a=s[0]
z=s[-1]
s=s[1:-1]
print(a+str(len(s))+z)
ab=input()
a=ab.split()[0]
b=ab.split()[1]
print("{0} {1}".format(a*b,((a+b)*2)))


### FIXED CODE ###

ab=input()
a=int(ab.split()[0])
b=int(ab.split()[1])
s=a*b
l=(a+b)*2
print("{0} {1}".format(s,l))
n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
dp = [float('inf')] * n
dp[0] = 0

for i in range(1, n):
    tmp = float("inf")
    for j in range(max(i - k, 0), i):
      	res = dp[j] + abs(h[i] - h[j])
        if tmp > res:
            tmp = res
    dp[i] = tmp

print(dp[n - 1])

### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    n = II()
    h = LI()
    dp = [0 for i in range(n)]
    dp[1] = abs(h[0] - h[1])
    for i in range(2,n):
        dp[i] = min(dp[i - 1] + abs(h[i - 1] - h[i]), dp[i - 2] + abs(h[i - 2] - h[i]))
    print(dp[n-1])
    return

#B
def B():
    n, K = LI()
    h = LI()
    dp = [float("INF") for i in range(n + K + 1)]
    dp[0] = 0
    for i in range(n):
        for k in range(1, K + 1):
            if i + k >= n:
                break
            dp[i + k] = min(dp[i + k], dp[i] + abs(h[i] - h[i + k]))
    print(dp[n-1])
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I():
    return 
#J

#K

#L

#M
#N
# O
# P
# Q
# R
# S
# T
# U
# V
# W
# X
# Y
# Z


#Solve
if __name__ == '__main__':
    B()
n = int(input())
dll =[]
for i in range(n):
    command = input().split()
    if command[0] == 'insert':
        dll.insert(0, command[1])
    elif command[0] == 'delete':
       # for i in range(len(dll)):
            #if dll[i] == command[1]: 
                #dll.pop(i)
                #break
        dll.remove(command[1])
    elif command[0] == 'deleteFirst':
        dll.pop(0)
    else:
        dll.pop()

print(*dll)

### FIXED CODE ###

from collections import deque

n = int(input())
dll = deque()
for i in range(n):
    command = input().split()
    if command[0] == 'insert':
        dll.appendleft(command[1])
    elif command[0] == 'delete':
        try:
            dll.remove(command[1])
        except:
            pass
    elif command[0] == 'deleteFirst':
        dll.popleft()
    else:
        dll.pop()
print(*dll)
def blackSum(x,y,x2,y2):
    return bs[y2][x2] - bs[y2][x-1] - bs[y-1][x2] + bs[y-1][x-1]

n,k = [int(i) for i in input().split()]
black = [[0 for i in range(2*k+2)] for j in range(2*k+2)]
for i in range(n):
    xi,yi,ci = list(input().split())
    x = int(xi)%(2*k)
    if ci == "W":
        y = (int(yi) + k)%(2*k)
    else:
        y = int(yi)%(2*k)
    black[y+2][x+2] += 1
bs = [[0 for i in range(2*k+2)] for j in range(2*k+2)]
for i in range(1,2*k+2):
    for j in range(1,2*k+2):
        bs[i][j] = black[i][j] + bs[i-1][j] + bs[i][j-1] - bs[i-1][j-1]
max = 0
#左上の黒の位置を指定する。
for i in range(2,k+2):
    for j in range(2,k+2):
        sum = blackSum(j,i,j+k-1,i+k-1) + \
              blackSum(1,1,j-1,i-1) + \
              blackSum(1,i+k,j-1,2*k+1) + \
              blackSum(j+k,1,2*k+1,i-1) + \
              blackSum(j+k,i+k,2*k+1,2*k+1)
        if sum>max:
            max=sum
print(max)
        
        
        
    



### FIXED CODE ###

a, b = list(map(int, input().split()))
if a*b%2 == 0:
    print("Even")
else:
    print("Odd")
N = int(input())
a = [int(i) for i in input().split()]
b =[]

for i in range(1,N+1):
    b.append(a.index(i) + 1)

print(*b, sep=' ')



### FIXED CODE ###

N, K = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
count = 0

for i in range(len(a)):
    if a[i] >= K:
        count += 1


print(count)
#include <bits/stdc++.h>
using namespace std;

int main() {
long long h;
long long w;

cin >> h >> w;


if((h*w)%2==0){
    cout<<h*w/2<<endl;
}
else{
    cout<<(h*w+1)/2<<endl;
}
  
}

### FIXED CODE ###

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

if((h==1)or(w==1)):
    print(1)
elif (h*w)%2==0:
    print(int(h*w/2))
else:
    print(int((h*w+1)/2))
import collections as cl
N = int(input())
a_li = [i for i in input().split()]
c = cl.Counter(a_li)

keys = list(c.keys())
max_sum = 0
if (len(c) == 1) :
    print(1)
elif (len(c) == 2) :
    if (abs(a_li[0] - a_li[1]) <= 1 ) :
        print(2)
    else :
        print(1)
else :
    for k in range(len(c) -2 ) :
        sum_v = c[keys[k]] + c[keys[k+1]] + c[keys[k+2]]
        if (max_sum < sum_v) :
            max_sum = sum_v
    
    print(max_sum)





### FIXED CODE ###

X ,t = [int(i) for i in input().split()]
if (X > t) :
    print(X-t)
else :
    print(0)
n = int(input())
A = int(input().split())
B = int(input().split())
C = int(input().split())
S = 0
before = 100

for i in range(n):
    S += B[A[i]]
    if A[i] == before + 1:
        S += C[before]
    before = A[i]

print(S)
    


### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
A = list(map(int,(input().split())))
B = list(map(int,(input().split())))
C = list(map(int,(input().split())))
S = 0
before = 100

for i in range(n):
    S += B[A[i]-1]
    if A[i]-1 == before + 1:
        S += C[before]
    before = A[i]-1

print(S)
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
from math import gcd
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a,b = iia()

print(int((a*b)/gcd(a,b)))

### FIXED CODE ###

import math
from math import ceil
from math import factorial
from collections import Counter
from operator import itemgetter
import bisect
ii = lambda: int(input())
iia = lambda: list(map(int,input().split()))
isa = lambda: list(input().split())

a = ii()
b = ii()

print(6-a-b)
print(input().count("1")

### FIXED CODE ###

print(input().count("1"))
import math
Num = 1000000007
N,K = map(int,input().split())

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


for i in range(1,K+1):
    tmp = conbinations_count(N-K+1,i)*conbinations_count(K-1,i-1)
    print(tmp%Num)

### FIXED CODE ###

import math
Num = 1000000007
N,K = map(int,input().split())

def conbinations_count(n, r):
    if n<0 or r<0 or n-r<0:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r)*math.factorial(r))


for i in range(1,K+1):
    tmp = conbinations_count(N-K+1,i)*conbinations_count(K-1,i-1)
    print(tmp%Num)
s=list(str(input()))
t=list(str(input()))
alphabet=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range (len(s)):
    for j in range (len(alphabet)):
        if s[i]==alphabet[j]:
            s[i]=j
for k in range (len(t)):
    for l in range (len(alphabet)):
        if t[k]==alphabet[l]:
            t[k]=l
if len(s)>len(t):
    lst=[-1]*(len(s)-len(t))
    t=t+lst

if len(t)>len(s):
    lst=[-1]*(len(t)-len(s))
    s=s+lst
import sys
for i in range (len(s)):
    if min(s)<max(t):
        print ('Yes')
        sys.exit()
    elif min(s)>max(t):
        print ('No')
        sys.exit()
    else:
        if min(s)==max(t):
            s.remove(min(s))
            t.remove(max(t))
print ('No')


### FIXED CODE ###

a,b=map(int,input().split())
import math
print(math.ceil((a+b)/2))
import sys
sys.setrecursionlimit(10**7)
#n,m=map(int,input().split())
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
if a[-1]<=0:
    x=a.pop()
    print(x-sum(a))
    for y in a:
        print(x,y)
        x=x-y
elif a[0]>=0:
    a=a[::-1]
    x=a.pop()
    print(-x+sum(a))
    while a:
        if len(a)>1:
            print(x,y)
            x=x-y
        else:
            print(y,x)
else:
    for i in range(n):
        if a[i]>0:
            ap=a[i:]
            an=a[:i]
            break
    print(sum(ap)-sum(an))
    z=ap.pop()
    x=an.pop()
    for y in ap:
        print(x,y)
        x=x-y
    for y in an:
        print(x,y)
        x=x-y
    print(z,x)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
#n,m=map(int,input().split())
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
if a[-1]<=0:
    x=a.pop()
    print(x-sum(a))
    for y in a:
        print(x,y)
        x=x-y
elif a[0]>=0:
    a=a[::-1]
    x=a.pop()
    print(-x+sum(a))
    while a:
        y=a.pop()
        if len(a)>0:
            print(x,y)
            x=x-y
        else:
            print(y,x)
            
else:
    for i in range(n):
        if a[i]>0:
            ap=a[i:]
            an=a[:i]
            break
    print(sum(ap)-sum(an))
    z=ap.pop()
    x=an.pop()
    for y in ap:
        print(x,y)
        x=x-y
    for y in an:
        print(z,y)
        z=z-y
    print(z,x)
a, b, x = map(int, input().split())
ans = 0

def fanc(n, x):
    if n == -1:
        f = 0
    else:
        f = n // x + 1 
                        # 切り捨て除算//を使うとint同士ならintで返してくれるから楽
    return f
print(fanc(b, x) - fanc(a - 1, x))

### FIXED CODE ###

a, b, c = map(str, input().split())
abb = a[0] + b[0] + c[0]
print(abb)
import sys
sys.setrecursionlimit(100000)


def process():
    data = []
    for line in get_data():
        line = line.split()
        if len(line) == 2:
            if line[0] == line[1] == '0':
                data = []
                continue
            H = int(line[0])
            W = int(line[1])
        elif len(line) == 0:
            pass
        else:
            data.append(line[0])
            if len(data) == H:
                field = create_field(H, W)
                print(search(H, W, data, field))


def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count


def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return


def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field


def get_data():
    return [line.strip() for line in input()]

process()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
A, B, C = map(int, input().split())


int ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)

### FIXED CODE ###

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


ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)
from math import ceil
def fanc(x):
    return int((ceil(x/10))*10)
menu = [int(input()) for _ in range(5)]
menu.sort(key=lambda x:x%10)
for i in range(5):
    if menu[i]%10:
        ans = menu.pop(i)
        break
menu = list(map(fanc, menu))
print(ans+sum(menu))

### FIXED CODE ###

from math import ceil
def fanc(x):
    return int((ceil(x/10))*10)
ans = 0
menu = [int(input()) for _ in range(5)]
menu.sort(key=lambda x:x%10)
for i in range(5):
    if menu[i]%10:
        ans += menu.pop(i)
        break
menu = list(map(fanc, menu))
print(ans+sum(menu))
s = str(input())
n = [s[-3], s[-2], s[-1]]
n = ''.join(n)
n = int(n)
if n == 0:
    print(0)
else:
    print(1000 - n)

### FIXED CODE ###

s = str(input())
if len(s) >= 3:
    n = [s[-3], s[-2], s[-1]]
if len(s) == 2:
    n = [s[-2], s[-1]]
if len(s) == 1:
    n = [s[0]]
n = ''.join(n)
n = int(n)
if n == 0:
    print(0)
else:
    print(1000 - n)
N, M = map(int, input().split())
E = [[] for i in range(N)]
for i in range(M):
    x, y = map(int, input().split())
    E[x-1].append(y-1)
dp = [-1] * N
def solve(n):
    if dp[n] != -1:
        return dp[n]
    dp[n] = 0
    for nn in E[n]:
        dp[n] = max(dp[n], solve(nn)+1)
    return dp[n]
ans = 0
for i in range(N):
    ans = max(ans, solve(i))
print(ans)

### FIXED CODE ###

from collections import deque
from collections import defaultdict
N, M = map(int, input().split())
d = [0]*N
G = defaultdict(list)
for i in range(M):
    s, t = map(int, input().split())
    d[t-1] += 1
    G[s-1].append(t-1)
q = deque([])
for i in range(N):
    if d[i] == 0:
        q.append(i)
ans = []
while q:
    s = q.popleft()
    ans.append(s)
    for t in G[s]:
        d[t] -= 1
        if d[t] == 0:
            q.append(t)
dp = [0] * (N+1)
num = 0
for i in range(0,N):
    for n in G[ans[i]]:
        dp[n] = max(dp[n], dp[ans[i]]+1)
print(dp[ans[-1]])
l = map(int, raw_input().split())
print(l(0) * l(1) - (l(0) + l(1) - 1))

### FIXED CODE ###

a, b = map(int, input().split())
 
print((a - 1) * (b - 1))
input()
d=[int(i) for i in input().split()]
i=0
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)

### FIXED CODE ###

n=input()
d=[int(i) for i in input().split()]
sum=0
while True:
  a=d[0]
  del d[0]
  if d == []:
    break
  for i in d:
    sum += a*i
print(sum)
str(input())
n = int(n[-1]) 
 
if n == 3:
    print("bon")
elif n in [0, 1, 6, 8]:
    print("pon")
else:
    print("hon")

### FIXED CODE ###

N = str(input())
last_num = int(N[-1]) 
 
if last_num == 3:
    print("bon")
elif last_num in [0, 1, 6, 8]:
    print("pon")
else:
    print("hon")
s = input()
a = len(s)-2
print(s[0]+a+s[len(s)-1])

### FIXED CODE ###

n,m = list(map(int,input().split()))
print((n-1)*(m-1))
a,b,c,d,e,f=input()
if c=d,e=f:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
n, p = map(int, input().split())

g = 1
res = 1
while g ** n <= p:
	if p % (g ** n) == 0:
		res = g
	g += 1

print(res)

### FIXED CODE ###

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

def prime_factor(n):
	d = {}
	for i in range(2, int(n ** 0.5) + 1):
		while (n % i == 0):
			d[i] = d.get(i, 0) + 1
			n //= i
	if n != 1:
		d[n] = d.get(n, 0) + 1
	return d

if n == 1:
	print(p)
	exit()

res = 1
fac = prime_factor(p)
for p, c in fac.items():
	res *= p ** (c // n)
print(res)
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 14:42:43 2018

@author: maezawa
"""

def print_array(g):
    ans = str(g[0])
    if len(g) > 1:
        for i in range(1,len(g)):
            ans += ' '+str(g[i]) 
    print(ans)

name=[]
time=[]
current_time = 0

n, q = list(map(int, input().split()))
for i in range(n):
    s = input().split()
    name.append(s[0])
    time.append(int(s[1]))
# =============================================================================
# print(n,q)
# print(name)
# print(time)
# =============================================================================
finished = []
fin_time = []
i=0
remain = n
while True:
    if time[i] <= q:
        current_time += time.pop(i)
        finished.append(name.pop(i))
        fin_time.append(current_time)      
        i = i%remain
        remain -= 1
        if remain == 0:
            break
    else:
        time[i] -= q
        current_time += q
        i = (i+1)%remain

for i in range(n):
    print("{} {}".format(finished[i], fin_time[i]))
        
    


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 18:04:22 2018
ALDS1_3b_r リングバッファによる実装
@author: maezawa
"""

def fifo_enque(data):
    global tail
    global fifo
    fifo[tail] = data
    tail = (tail+1)%fifo_size
    
def fifo_deque():
    global head
    global fifo
    data = fifo[head]
    head = (head+1)%fifo_size
    return data

fifo_size = 100000
fifo = [0 for _ in range(fifo_size)]
head = 0
tail = 0

n, q = list(map(int, input().split()))
for i in range(n):
    s = input().split()
    data = [s[0], int(s[1])]
    fifo_enque(data)
    
current_time = 0
finished = []
fin_time = []

while True:
    data = fifo_deque()
    if data[1] > q:
        current_time += q
        data[1] -= q
        fifo_enque(data)
    else:
        current_time += data[1]
        finished.append(data[0])
        fin_time.append(current_time)
    if head == tail:
        break

for i in range(n):
    print("{} {}".format(finished[i], fin_time[i]))
n,y=map(int,input().split())
if y>10000*n:
  print('-1 -1 -1')
else:
  for p in range(n+1):
    for q in range(n-p+1):
      if 10000*p+5000*q+1000*(n-p-q)==y:
        print(p,q,r)
        exit()
  print('-1 -1 -1')
        

### FIXED CODE ###

n,y=map(int,input().split())
if y>10000*n:
  print('-1 -1 -1')
else:
  for p in range(n+1):
    for q in range(n-p+1):
      if 10000*p+5000*q+1000*(n-p-q)==y:
        print(p,q,n-p-q)
        exit()
  print('-1 -1 -1')