Harryxun/stf_run huggingface dataset:
n,k = map(int, input().split())
a = list(map(int, input().split()))

G = {}
for i in range(1, n + 1):
    G.update({i: a[i - 1]})

seen = [False] * (n + 1)
path = []

def dfs(graph, start):
    global return_ans
    seen[start] = True
    path.append(start)
    
    if seen[graph[start]]:
        return_ans = graph[start]
    else:
        dfs(graph, graph[start])
    
    return return_ans

point = dfs(G, 1)
long = len(path)
m = path.index(point)
ans = (k + 1) % (long - m)
path = path[m:]
print(path[ans])


### FIXED CODE ###

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

G = {}
for i in range(1, n + 1):
    G.update({i: a[i - 1]})

seen = [False] * (n + 1)
path = [1]

i = 1
while True:
    seen[i] = True
    i = G[i]
    
    if seen[i]:
        break
    else:
        path.append(i)

m = path.index(i)

if m > k:
    print(path[k])
else:
    k -= m
    path = path[m:]
    k %= len(path)
    print(path[k])
x = [int(input()) for _ in range(6)]
print(':(' if x[-2]-[0] > x[-1] else 'Yay!')

### FIXED CODE ###

x = [int(input()) for _ in range(6)]
print(':(' if x[-2]-x[0] > x[-1] else 'Yay!')
n=int(input())
l=[input() for j in range(n)]
for i in range(n)[:-1]:
	f=l[i]
	for s in range(n)[i+1:]:
		a=[f[k] for k in range(10)]
        g=l[s]
        b=[g[c] for c in range(10)]
        q +=1 if sorted(a)==sorted(b)
print(q)

### FIXED CODE ###

from collections import Counter as co
from operator import mul
from functools import reduce

def combinations_count(n, r):
  r = min(r, n - r)
  numer = reduce(mul, range(n, n - r, -1), 1)
  denom = reduce(mul, range(1, r + 1), 1)
  return numer//denom


n=int(input())
a=0
l=[''.join(list(map(str,sum(sorted(list(map(list,co(input()).items()))),[])))) for i in range(n)]
for d,s in co(l).items():
  if s>=2:a+=combinations_count(s, 2)
print(a)
A,B,C=input().split()
if A[-1]==B[0] and B[-1]=C[0]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

A,B,C=input().split()
if A[-1]==B[0] and B[-1]==C[0]:
  print('YES')
else:
  print('NO')
N, M = input().split()
X = list(map(int, input().split()))

if N >= M:
    print(0)
else:
    X.sort()
    L = []
    for i in range(M-1):
        L.append(X[i+1]-X[i])
    L.sort(reverse=True)
    print(X[M]-X[0]-sum(L[:N-1]))


### FIXED CODE ###

N, M = map(int, input().split())
X = list(map(int, input().split()))

if N >= M:
    print(0)
else:
    X.sort()
    L = []
    for i in range(M-1):
        L.append(X[i+1]-X[i])
    L.sort(reverse=True)
    print(X[M-1]-X[0]-sum(L[:N-1]))
N, K = map(int, input().split())

S = list(input())

S[K-1] = S[K-1].lower()

for i in S:
    s_new += i
    
print(s_new)

### FIXED CODE ###

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

S = list(input())

S[K-1] = S[K-1].lower()

s_new = ""
for i in range(N):
  s_new += S[i]
    
print(s_new)
from itertools import combinations
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations(range(1,M+1), 3))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): # 0,1,2,3 A
    for j in range(Q): # 0,1,2
        bi = P[j][1]
        ai = P[j][0]
        
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)

### FIXED CODE ###

import itertools
N, M, Q = map(int,input().split())
P = [list(map(int,input().split())) for i in range(Q)]

A = list(itertools.combinations_with_replacement(range(1,M+1), N))
number = len(A)

amount = 0
max_amount = 0
for i in range(number): #A
    
    for j in range(Q): # P
        bi = P[j][1]
        ai = P[j][0]
        if(A[i][bi-1] - A[i][ai-1] == P[j][2]):
            amount += P[j][3]
        
   # print(amount)
    
   # print(amount)
    if(amount >= max_amount):
        max_amount = amount
    
    amount = 0
    
print(max_amount)
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    from functools import reduce
    assert N % 2 == 0
    b = reduce(lambda a, b: a ^ b, a)
    return [aa ^ b for aa in a]

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(*solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    from functools import reduce
    assert N % 2 == 0
    b = reduce(lambda a, b: a ^ b, a)
    return [aa ^ b for aa in a]

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(*solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, a: "List[int]"):
    from functools import reduce
    assert N % 2 == 0
    b = reduce(lambda a, b: a ^ b, a)
    return [aa ^ b for aa in a]

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(*solve(N, a))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())

ans = 0
hands = []
for i in range(N):
    if i <= K - 1:
        # グー
        if T[i] == 'r':
            ans += P
            hands.append('p')
        # チョキ
        elif T[i] == 's':
            ans += R
            hands.append('r')
        # パー
        else:
            ans += S
            hands.append('s')
    else:
        if T[i] == 'r':
            if hands[i-K] != 'p':
                ans += P
                hands.append('p')
            else:
                if i + K <= N:
                    hands.append(list(set('rsp') - set([T[i+K], hands[i-K]]))[0])
        # チョキ
        elif T[i] == 's':
            if hands[i-K] != 'r':
                ans += R
                hands.append('r')
            else:
                if i + K <= N:
                    hands.append(list(set('rsp') - set([T[i+K], hands[i-K]]))[0])
        # パー
        else:
            if hands[i-K] != 's':
                ans += S
                hands.append('s')
            else:
                if i + K <= N:
                    hands.append(list(set('rsp') - set([T[i+K], hands[i-K]]))[0])
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())

ans = 0
hands = []
for i in range(N):
    if i < K:
        # グー
        if T[i] == 'r':
            ans += P
            hands.append('p')
        # チョキ
        elif T[i] == 's':
            ans += R
            hands.append('r')
        # パー
        else:
            ans += S
            hands.append('s')
    else:
        if T[i] == 'r':
            if hands[i-K] != 'p':
                ans += P
                hands.append('p')
            else:
                if i + K <= N - 1:
                    hands.append('-')
                else:
                    hands.append('-')
        # チョキ
        elif T[i] == 's':
            if hands[i-K] != 'r':
                ans += R
                hands.append('r')
            else:
                if i + K <= N - 1:
                    hands.append('-')
                else:
                    hands.append('-')
        # パー
        else:
            if hands[i-K] != 's':
                ans += S
                hands.append('s')
            else:
                if i + K <= N - 1:
                    hands.append('-')
                else:
                    hands.append('-')

print(ans)
from math import pi

r = int(input())
print("{:.6f} {:.6f}".format(r * r * pi, 2 * r * pi))

### FIXED CODE ###

from math import pi

r = float(input())
area = r**2 * pi
length = 2 * r * pi
print("{:.6f} {:.6f}".format(area, length))
a,b,c,d = int(input())

l = list[]
l.append(a*c)
l.append(b*c)
l.append(a*d)
l.append(b*d)

print(max(l))

### FIXED CODE ###

a,b,c,d = map(int,input().split())
 
l = []
l.append(a*c)
l.append(b*c)
l.append(a*d)
l.append(b*d)
 
print(max(l))
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]

dp = [0] * (n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0
    
for i in range(2,n+1):
    if i in a:
        pass
    else:
        dp[i] = dp[i-1] + dp[i-2]
        
print(dp[n]%MOD)

### FIXED CODE ###

n,m = map(int,input().split())
a = set([int(input()) for _ in range(m)])
MOD = 1000000007
dp = [0] * (n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0
    
for i in range(2,n+1):
    if i in a:
        continue
        
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= MOD
        
print(dp[n])
a, b = map(int, input().split())
print(a if b>=a else a-1)
a, b = map(int, input().split())
print(a if b>=a else a-1)


### FIXED CODE ###

a, b = map(int, input().split())
print(a if b>=a else a-1)
a, b, c = (int(x) for x in input().split())

if a - b >= c:
    print(0)
else:
    print(c - (a - b)

### FIXED CODE ###


a, b, c = (int(x) for x in input().split())

if a == b:
    print(c)
elif a - b >= c:
    print(0)
else:
    print(c - (a - b))
n, l = map(int, input().split())
lists = []
for i in range(n):
    list.apend(input())
lists.sort()
s = ''
for list in lists:
    s += list
print(s)

### FIXED CODE ###

n, l = map(int, input().split())
list = []
for i in range(n):
    list.append(input())
list.sort()
s = ''.join(list)
print(s)
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))


a,b,c  = cin()
p = -1
q = 1e9
r = -1
s = 1e9
for i in range(c):
  x,y,z = cin()
  if z==1:
    p = max(x,p)
  elif z==2:
    q = min(x,q)
  elif z==3:
    r = max(r,y)
  else:
    s = min(s,y)

if p==-1:
    p = 0
if q==1e9:
    q = a
if r==-1:
    r=0
if s==1e9:
    s=b

# v = a-(a-p-1+a-q)
# w = b-(b-r+b-s)
# print(v,w)
ans = (q-p)*(s-r)
print(ans if ans>0 else 0)

# l1 = list(range(0,p+1))
# l2 = list(range(q,a))
# l1 = set(l1)
# l2 = set(l2)
# l3 = l1.union(l2)

# l4 = list(range(0,r))
# l5 = list(range(s,b+1))
# l4 = set(l4)
# l5 = set(l5)
# l6 = l4.union(l5)
# # print(l3,l6)
# # print(l1,l2)
# # print(p,q,r,s)
# if(len(l3)==a or len(l6)==b):
#     print(0)
# else:
#     print((a-len(l3)+1)*(b-len(l6)+1))
    
    
  


### FIXED CODE ###

def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))



a = cina()
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")
N, A, B = map(int,input().split())

q, mod = divmod(N, A+B)


if A == 0 :
    print(0)

elif N >A+B :
    if mod <= A :
        print(q*A+mod)
    if mod > A :
        print(q*A+A)
    
elif N == A+B :
    print(q*A)

elif N < A+B :
    print(N)

### FIXED CODE ###

S = input()
if S == 'AAA' or S == 'BBB' :
    print('No')
else :
    print('Yes')
na = lambda: list(map(int, stdin.readline().split()))
n, i = na()

print(n - i + 1)

### FIXED CODE ###

import sys
stdin = sys.stdin

na = lambda: list(map(int, stdin.readline().split()))
n, i = na()

print(n - i + 1)
n=int(input()
print(int(n//3))

### FIXED CODE ###

n=int(input())
print(int(n//3))
from typing import List
N, M = map(int, input().split())
graph:List[List[int]] = [[] for _ in range(N)]
for _ in range(N):
    a,b = map(lambda x : int(x) -1 , input().split())
    graph[a].append(b)
    graph[b].append(a)
prev = [-1]*N
prev[0] = 0
import queue
qu = queue.Queue()
qu.put(0)
while not qu.empty():
    top = qu.get()
    for nxt in graph[top]:
        if prev[nxt] == -1:
            prev[nxt] = top
            qu.put(nxt)
if all(x != -1 for x in prev[1:]):
    print("\n".join(map(lambda x : str(x+1), prev[1:])))
else :
    print("no")

### FIXED CODE ###

from typing import List
N, M = map(int, input().split())
graph:List[List[int]] = [[] for _ in range(N)]
for _ in range(M):
    a,b = map(lambda x : int(x) -1 , input().split())
    graph[a].append(b)
    graph[b].append(a)
prev = [-1]*N
prev[0] = 0
import queue
qu = queue.Queue()
qu.put(0)
while not qu.empty():
    top = qu.get()
    for nxt in graph[top]:
        if prev[nxt] == -1:
            prev[nxt] = top
            qu.put(nxt)
if all(x != -1 for x in prev[1:]):
    print("Yes")
    print("\n".join(map(lambda x : str(x+1), prev[1:])))
else :
    print("No")
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
l = []
l2 = []
l3 = [0 for i in range(n)]
cnt = 0
if (m == 0 and n == 1) or (n == 1 and m == 1 and sc[0] == [1, 0]):
    print(0)
    exit()
for i in sc:
    if i[0] == 1 and i[1] == 0:
        print(-1)
        exit()
    elif i[0] in l and l2[l.index(i[0])] != i[1]:
        print(-1)
        exit()
    else:
        l.append(i[0])
        l2.append(i[1])
        l3[i[0] - 1] = i[1]
        cnt += 1
if l3[0] == 0:
    l3[0] = 1
print(*l3, sep="")

### FIXED CODE ###

N = int(input())
if N % 2 == 0:
  print(int(N / 2))
else:
  print(int(N / 2 + 1))
import math

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

ans = A[0]
for i in range(1, N):
    ans = math.gcd(ans, A[i])
print(ans)


### FIXED CODE ###

import fractions

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

ans = A[0]
for i in range(1, N):
    ans = fractions.gcd(ans, A[i])
print(ans)
import fractions

A, B =list(map(int, input().split()))
D = fractions.gcd(A,B)
arr = []
temp = D
if D != 1:
  for i in range(2, int(-(-D**0.5//1)+2)):
    if temp%i == 0:
      while temp%i == 0:
        temp //= i
      arr.append(i)
    if len(arr) == 0:
      append.arr(D)
else:
  pass
print(len(arr)+1)

### FIXED CODE ###

import fractions

A, B =list(map(int, input().split()))
D = fractions.gcd(A,B)
arr = []
temp = D
if D == 1:
  pass
else:
  for i in range(2, int(-(-D**0.5//1)+1)):
    if temp%i == 0:
      while temp%i == 0:
        temp //= i
      arr.append(i)
  if temp != 1:
    arr.append(D)
print(len(arr)+1)
a = input()

 ret = ""
 cnt = 0
 for i in a:
     if i == "B":
         ret = ret[:-1:]
     else:
         ret += i
 print(ret)


### FIXED CODE ###

a = input()

ret = ""
cnt = 0
for i in a:
    if i == "B":
        ret = ret[:-1:]
    else:
        ret += i
print(ret)
import sys
sys.setrecursionlimit(10**6)
N = int(input())
v = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a,b = a-1,b-1
    v[a].append([b,i])

ans = [None] * (N-1)

def decide_colord(cur,color):
    cnt = 1
    for (to,j)in v[cur]:
        if cnt == color:
            cnt += 1
        ans[j] = cnt
        decide_colord(to,cnt)
        cnt += 1
decide_colord(0,0)
print(max(ans))
[print(a) for a in ans]

### FIXED CODE ###

day = {'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
s = input()
print(day[s])
#coding: utf-8
from collections import deque

H, W = (int(x) for x in input().split())
A = []

posOdd = deque() 
for i in range(H):
    row = [int(x) for x in input().split()]
    A.append(row)
    if i % 2 == 0:
        for j in range(W):
            if row[j] % 2 == 1:
                posOdd.append([i, j])
    else:
        for j in reversed(range(W)):
            if row[j] % 2 == 1:
                posOdd.append([i, j])


def move(src, dst):
    ret = []
    while src[1] != dst[1]:
        if src[1] > dst[1]:
            dj = -1
        else:
            dj = 1
        ret.append((src[0], src[1], src[0], src[1]+dj))
        src[1] += dj 

    while src[0] != dst[0]:
        if src[0] > dst[0]:
            di = -1
        else:
            di = 1
        ret.append(src[0], src[1], src[0]+di, src[1])
        src[0] += di 
    return ret

moves = []
while len(posOdd) > 1:
    dst = posOdd.popleft()
    src = posOdd.popleft()
    moves += move(src, dst)

print(len(moves))
for m in moves:
    print(" ".join((str(i+1) for i in m)))


### FIXED CODE ###

#coding: utf-8
from collections import deque

H, W = (int(x) for x in input().split())
A = []

curMove = []
moves = []
hasOdd = False
pi = -1
pj = -1
for i in range(H):
    row = [int(x) for x in input().split()]
    if i % 2 == 0:
        start, end, diff = 0, W, 1
    else:
        start, end, diff = W-1, 0-1, -1

    for j in range(start, end, diff):
        if row[j] % 2 == 1:
            if hasOdd:
                curMove.append((pi,pj, i, j))
                moves += curMove
                curMove = []
                hasOdd = False
            else:
                hasOdd = True
        else:
            if hasOdd:
                curMove.append((pi,pj, i, j))
        pi = i
        pj = j

print(len(moves))
for m in moves:
    print(" ".join((str(i+1) for i in m)))
def min_cost(stones, N):
    def jump(stones, index, N):
        if index == N:
            return 0

        if dp[index] != -1:
            return dp[index]

        left = abs(stones[index] - stones[index + 1]) + jump(stones, index + 1, N)

        right = 2 ** 31
        if index + 2 <= N:
            right = abs(stones[index] - stones[index + 2]) + jump(stones, index + 2, N)

        dp[index] = min(left, right)

        return dp[index]

    dp = [-1] * N
    return jump(stones, 0, N - 1)


if __name__ == '__main__':
    N = int(input())
    #stones = list(map(int, input().strip().split()))
    stones = [int(a) for a in input().strip().split()]
    print(min_cost(stones, N))

    



'''
    stones = [30, 10, 60, 10, 60, 50]
    N = 6
    print(min_cost(stones, N))

    stones = [10, 30, 40, 20]
    N = 4
    print(min_cost(stones, N))
'''


### FIXED CODE ###



def min_cost(stones, N):
    space = [0] * N

    for i in range(1, N):
        one = abs(stones[i] - stones[i - 1]) + space[i - 1]
        
        two = 2 ** 31

        if i - 2 >= 0:
            two = abs(stones[i] - stones[i - 2]) + space[i - 2]

        space[i] = min(one, two)

    return space[i]


if __name__ == '__main__':
    N = int(input())
    #stones = list(map(int, input().strip().split()))
    stones = [int(a) for a in input().strip().split()]
    print(min_cost(stones, N))
    
    '''
    stones = [30, 10, 60, 10, 60, 50]
    N = 6
    print(min_cost(stones, N))
    

    stones = [10, 30, 40, 20]
    N = 4
    print(min_cost(stones, N))
    '''
from bisect import bisect_left
import heapq
n=int(input())
l=[]
l.append(int(input()))
heapq.heapify(l)
for i in range(n-1):
    a=int(input())
    x=bisect_left(l,a)
    if x==0:
        heapq.heappush(l,a)
    else:
        l[x-1]=a
    print(l)
print(len(l))

### FIXED CODE ###

from bisect import bisect_right,bisect_left
n=int(input())
a=[int(input()) for _ in range(n)]
INF=float('INF')
l=[INF]*n
for i in a[::-1]:
    l[bisect_right(l,i)]=i
print(bisect_left(l,INF))
"""負辺ありの有向グラフの最短経路問題、ベルマンフォード法"""

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

INF = 1001001001

to = [[] for _ in range(2505)]
rto = [[] for _ in range(2505)]
reachableFrom1 = [False for _ in range(2505)]
reachableToN = [False for _ in range(2505)]
ok = [False for _ in range(n)]

def dfs(v):
    """1から到達できる頂点の列挙"""
    if reachableFrom1[v]: return
    reachableFrom1[v] = True
    for u in to[v]:
        dfs(u)

def rdfs(v):
    """Nに到達できる頂点の列挙"""
    if reachableToN[v]: return
    reachableToN[v] = True
    for u in rto[v]:
        rdfs(u)

edges = []
for i in range(m):
    a,b,c = map(int, input().split())
    a -= 1; b -= 1
    c -= p
    c = -c
    edges.append((a,b,c))
    to[a].append(b) # 到達可能性を判定するための変数
    rto[b].append(a) # nに辿り着けるかを判定するための変数
    
dfs(0)
rdfs(n-1)
for i in range(n):
    ok[i] = reachableFrom1[i] & reachableToN[i] # okになっている頂点だけを考える
# ベルマンフォード
def main():
    global edges, ok
    d = [INF for _ in range(n)]
    d[0] = 0
    upd = True
    step = 0 # 負閉路検出用。更新回数がnステップを超えたら負閉路あり
    while upd:
        upd = False
        for i in range(m):
            a,b,c = edges[i]
            if not ok[a]: continue
            if not ok[b]: continue
            newD = d[a]+c
            if newD < d[b]:
                upd = True
                d[b] = newD
        step += 1
        if step > n:
            print(-1)
            return
    ans = -d[n-1]
    ans = max(ans,0)
    print(ans)
    return
    
main()

### FIXED CODE ###

"""負辺ありの有向グラフの最短経路問題、ベルマンフォード法"""
import sys
sys.setrecursionlimit(10**6)

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

INF = 1001001001

to = [[] for _ in range(2505)]
rto = [[] for _ in range(2505)]
reachableFrom1 = [False for _ in range(2505)]
reachableToN = [False for _ in range(2505)]
ok = [False for _ in range(2505)]

def dfs(v):
    """1から到達できる頂点の列挙"""
    if reachableFrom1[v]: return
    reachableFrom1[v] = True
    for u in to[v]:
        dfs(u)

def rdfs(v):
    """Nに到達できる頂点の列挙"""
    if reachableToN[v]: return
    reachableToN[v] = True
    for u in rto[v]:
        rdfs(u)

edges = []
for i in range(m):
    a,b,c = map(int, input().split())
    a -= 1; b -= 1
    c -= p
    c = -c
    edges.append((a,b,c))
    to[a].append(b) # 到達可能性を判定するための変数
    rto[b].append(a) # nに辿り着けるかを判定するための変数
    
dfs(0)
rdfs(n-1)
for i in range(n):
    ok[i] = reachableFrom1[i] & reachableToN[i] # okになっている頂点だけを考える
# ベルマンフォード
def main():
    global edges, ok
    d = [INF for _ in range(n)]
    d[0] = 0
    upd = True
    step = 0 # 負閉路検出用。更新回数がnステップを超えたら負閉路あり
    while upd:
        upd = False
        for i in range(m):
            a,b,c = edges[i]
            if not ok[a]: continue
            if not ok[b]: continue
            newD = d[a]+c
            if newD < d[b]:
                upd = True
                d[b] = newD
        step += 1
        if step > n:
            print(-1)
            return
    ans = -d[n-1]
    ans = max(ans,0)
    print(ans)
    return
    
main()
import math

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

sakaime = a * a * b / 2

if x > sakaime:
    tan = a / (2 * (b - (x / (a ** 2))))
else:
    tan = 2 * x / (a * (b**2))

ans = math.degrees(math.atan(tan))

if ans >= 0:
    print(90-ans)

### FIXED CODE ###

import math

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

sakaime = a * a * b / 2

if x > sakaime:
    try:
        tan = a / (2 * (b - (x / (a ** 2))))
    except:
        tan = float('inf')
else:
    tan = 2 * x / (a * (b**2))

ans = math.degrees(math.atan(tan))

if ans >= 0:
    print(90-ans)
while True :
    num = input().strip()
    num = num.split()
    x = int(num[0])
    y = int(num[1])
    if y < x :
        print(y,x)
    elif x <= y :
        print(x,y)
    else :
        break

### FIXED CODE ###

while True:
    (x, y) = [int(i) for i in input().split()]
    
    if x == y == 0 :
        break

    if x <= y :
        print(x, y)
    else :
        print(y, x)
print("YES" if input()[0]==input()[2] else "No")

### FIXED CODE ###

s=input()
print("Yes" if s[0]==s[2] else "No")