Harryxun/stf_run huggingface dataset:
if __name__ == '__main__':
    N = int(input())

    answer = -1
    for i in range(N, 999):
        i_str = str(i)
        if i_str[0] == i_str[1] and i_str[1] == i_str[2]:
            answer = i_str
            break
    print(i_str)

### FIXED CODE ###

if __name__ == '__main__':
    N = int(input())

    answer = -1
    for i in range(N, 1000):
        i_str = str(i)
        if i_str[0] == i_str[1] and i_str[1] == i_str[2]:
            answer = i_str
            break
    print(i_str)
import numpy as np
k, n = map(int, input().split())
a = np.array(list(map(int, input().split())))
print(max(abs(a1 - a2)))

### FIXED CODE ###

import numpy as np
k, n = map(int, input().split())
a = np.array(list(map(int, input().split())))
a1 = np.zeros(1, dtype=int)
a1 = np.append(a1, a)
a2 = a
a2 = np.append(a2, a[0]+k)
print(k - max(a2[1:] - a1[1:]))
A, B = [int(i) for i in input().split()]
int C

if A == 2 or B == 2:
  print("No")
  
elif C == 1 or C ==3:
  print("Yes")

### FIXED CODE ###

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

if (A == 2) or (B == 2):
  print("No")
  
else:
  print("Yes")
n,a,b = map(int,input()split())
div=n//(a+b)
mod=n%(a+b)
print(div*a+min(mod,a))

### FIXED CODE ###

N,A,B=map(int,input().split())
div=N//(A+B)
mod=N%(A+B)
print(div*A+min(mod,A))
a = [float(i) for i in input().split()]
print(int(a))


### FIXED CODE ###

tmp = [i for i in input().split()]

a = int(tmp[0])
b = int(float(tmp[1]) * 1000)

result = a*b//1000
print(result)
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


n, k = sp()
arr = l()
answer = [1]
s = {1}
index = 1
while True:
    temp = arr[answer[-1]-1]
    if temp in s:
        index = temp
        break
    s.add(temp)
    answer.append(temp)
if k <= len(answer)-1:
    out(answer[k-1])
    exit()
# print(answer)
k -= (len(answer)-1)
temp = answer.index(index)
answer = answer[index:]
# print(k)
k %= len(answer)-1
if k == 0:
    k = len(answer)
print(answer[k-1])


### FIXED CODE ###

import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(pow(10, 6))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


n, k = sp()
arr = l()
answer = [1]
s = {1}
index = 1
while True:
    temp = arr[answer[-1]-1]
    if temp in s:
        index = temp
        break
    s.add(temp)
    answer.append(temp)
if k <= len(answer)-1:
    out(answer[k])
    exit()
k -= (len(answer)-1)
temp = answer.index(index)
answer = answer[temp:]
k %= len(answer)
if k == 0:
    k = len(answer)
out(answer[k-1])
import sys
import math
input = sys.stdin.readline

N = int(input())
x = []
y = []

for i in range(N):
    p, q = map(int, input().split())
    x.append(p)
    y.append(q)

ans = 0

for i in range(N):
    for j in range(N):
        if i == j:
            continue
#        print ("i="+str(i)+", j="+str(j))
#        print ("xi="+str(x[i])+", xj="+str(x[j]))
#        print ("yi="+str(y[i])+", yj="+str(y[j]))
        ans += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = ans / N
print (ans)


### FIXED CODE ###


r = int(input())
print (r*r)
N,M = map(int,input().split())

RES = []

for i in range(M):
    RES.append(list(input().split()))

WA = [0]*(M+2)
ACed = [0]*(N+2)
tmp = 0
for i in range(M):
    num = int(RES[i][0])
    if RES[i][1] == "WA" and not ACed[num]:
        WA[num] += 1
    elif RES[i][1] == "WA" and ACed[num]:
        tmp += 1
    else:
        ACed[num] = 1

print(sum(ACed),end=" ")
print(sum(WA))

### FIXED CODE ###

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

RES = []

for i in range(M):
    RES.append(list(input().split()))

WA = [0]*(M+N)
ACed = [0]*(N+M)
tmp_num = [0]*(M+N)
tmp = 0
for i in range(M):
    num = int(RES[i][0])
    if RES[i][1] == "WA" and not ACed[num]:
        tmp_num[num] += 1
    elif RES[i][1] == "WA" and ACed[num]:
        tmp += 1
    else:
        ACed[num] = 1
        WA[num] = tmp_num[num]

print(sum(ACed),end=" ")
print(sum(WA))
from scipy.sparse import*;f=lambda*z:map(int,input().split());n,=f();a,b=zip(*map(f,[0]*~-n));g,h=csgraph.dijkstra(csr_matrix(([1]*~-n,(a,b)),[n+1]*2),0,[1,n]);print('FSennunkeec'[sum(g[i]>h[i]for i in range(n+1))*2/n::2])

### FIXED CODE ###

from scipy.sparse import*;f=lambda*z:map(int,raw_input().split());n,=f();a,b=zip(*map(f,[0]*~-n));g,h=csgraph.dijkstra(csr_matrix(([1]*~-n,(a,b)),[n+1]*2),0,[1,n]);print'FSennunkeec'[sum(g[i]>h[i]for i in range(n+1))*2>=n::2]
def main(A,D,N):
    K=min(N,len(D))
    for i in range(K):
        if A[i]>D[i]:
            return sum(D[:i]+A[i:])
    return sum(D[:K]+A[K:])

N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
CB=[]
for m in range(M):
    b,c=map(int,input().split())
    CB.append([c,b])
CB.sort()
CB.reverse()
D=[]
while len(D)<N and CB!=[]:
    D.append(CB[0][0])
    CB[0][1]-=1
    if CB[0][1]==0:
        CB.remove(CB[0])
for bc in BC:
    B+=[bc[0]]*bc[1]
print(main(A,D,N))

### FIXED CODE ###

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

BC=[]
for m in range(M):
    b,c=map(int,input().split())
    BC.append([b,c])

A.sort()
BC.sort(key=lambda x:x[1],reverse=True)

D=[]
for [b,c] in BC:
    D+=[c]*b
    if len(D)>N:
        break

if len(D)<N:
    D+=[0]*(N-len(D))

AD=[max(A[i],D[i]) for i in range(N)]
 
print(sum(AD))
import sys
n = [int(i) for i in input().split()]
a = []
for i in range(n[1]):
    a.append(int(input()))

a.append(n[0]+1)
a = sorted(list(set(a)))


def k(i):
    if i <= 1:
        return 1
    elif i == 2:
        return 2
    else:
        return k(i-2)+k(i-1)


for i in range(1, len(a)):
    if a[i]-a[i-1] == 1:
        print(0)
        sys.exit()
j = -1
ans = 1
for i in a:
    ii = i-j-2
    ans = ans*k(ii)
    j = i
if len(a) == 1:
    ans = k(n[0])
print(ans % 1000000007)


### FIXED CODE ###

import sys
n = [int(i) for i in input().split()]
a = []
for i in range(n[1]):
    a.append(int(input()))

a.append(n[0]+1)
a = sorted(list(set(a)))


def k(i):
    ans = 1
    pri = 0
    for idx in range(i):
        tmp = ans
        ans += pri
        pri = tmp
    return ans


for i in range(1, len(a)):
    if a[i]-a[i-1] == 1:
        print(0)
        sys.exit()
j = -1
ans = 1
for i in a:
    ii = i-j-2
    ans = ans*k(ii)
    j = i
if len(a) == 1:
    ans = k(n[0])
print(ans % 1000000007)
N = int(input())

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c))
    graph[b-1].append((a-1, c))


color = [-1 for _ in range(N)]
def dfs(p, c, color):
    color[p] = c
    cinv = 0 if c == 1 else 1
    for q, d in graph[p]:
        if color[q] != -1:
            continue
        if d % 2 == 1:
            color = dfs(q, cinv, color)
        else:
            color = dfs(q, c, color)
    return color
A = dfs(0, 0, color)
for a in A:
    print(a)

### FIXED CODE ###

N = int(input())
import sys
sys.setrecursionlimit(90000)

graph = [[] for _ in range(N)]
for _ in range(N-1):
    a, b, c = map(int, input().split())
    graph[a-1].append((b-1, c))
    graph[b-1].append((a-1, c))

color = [-1 for _ in range(N)]
def dfs(p, c, color):
    color[p] = c
    cinv = 0 if c == 1 else 1
    for q, d in graph[p]:
        if color[q] != -1:
            continue
        if d % 2 == 1:
            color = dfs(q, cinv, color)
        else:
            color = dfs(q, c, color)
    return color

A = dfs(0, 0, color)
for a in A:
    print(a)
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

n = int(input())
t = [0]*n
for i in range(n):
    t[i] = int(input())
    
ans = t[0]
    
for i in range(1,n):
    ans = ans * t[i] // gcd(ans , t[i])
    
print(ans)

### FIXED CODE ###

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

for _ in range(n):
    a , b = map(int,input().split())
    dic.setdefault(a , 0)
    dic[a] += b
    
sdic = sorted(dic.items(), key = lambda x : x[0])

for i in range(n):
    k -= sdic[i][1]
    
    if k <= 0:
        print(sdic[i][0])
        break
def main():
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())

    if b == 
    a += 10**9
    b += 10**9
    if v == w:
        print('NO')
        return 0
#    if a > b:
#        print('NO')
#        return 0
    if (b-a)%(v-w) != 0:
        print('NO')
    elif 0 <= (b-a)/(v-w) <= t:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    a,v = map(int,input().split())
    b,w = map(int,input().split())
    t = int(input())

    if v == w:
        print('NO')
        return 0
    if v-w < 0:
        print('NO')
        return 0
    if abs(b-a)/(v-w) <= t:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
input = raw_input()

if(input>9):
    print("error")
elif(input == 3 or input == 5 or input == 7):
    print("YES")
else:
    print("NO")

### FIXED CODE ###


inp = input()

if inp == "3" or inp == "5" or inp == "7" :
    print("YES")
else:
    print("NO")
n = int(input())
h = list(map(int, input().split()))
cnt = 0
move_cnt = []
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      move_cnt.append(cnt)
   else:
      move_cnt.append(cnt) 
      cnt = 0
      
print(max(move_cnt))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
cnt = 0
ans = 0
for i in range(n-1):
   if h[i] >= h[i+1]:
      cnt += 1
      ans = max(ans, cnt)
   else:
      cnt = 0
print(ans)
N,K,Q = map(int,input().split())

min_c = Q - K + 1

num = [0]*N

for i in range(Q):
    a = int(input())
    num[a-1]+=1

for j in num:
    if num[j] >= min_c:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

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

min_c = Q - K + 1

num = [0]*N

for i in range(Q):
    a = int(input())
    num[a-1]+=1

for j in num:
    if j >= min_c:
        print('Yes')
    else:
        print('No')
import sys

N = int(input())
Atmp = [0] + list(map(int, input().split()))
A = {}

for i,a in enumerate(Atmp):
    A[i] = a

#print(A)

X = {}

for i in reversed(list(range(1,N+1))):
    Xsum = 0
    j = 2
    while(i*j =< N):
        Xsum += X[i*j]
        j += 1
        continue
    odd = Xsum % 2
    if odd == A[i]:
        X[i] = 0
    else:
        X[i] = 1
    



def umeru(X, M, last):
    #print('---')
    for i in reversed(list(range(N//(M+1)+1, N//M+1))):
        if M == 1:
            X[i] = A[i]
        else:
            Xsum = 0
            j = 2
            while(i*j < N):
                Xsum += X[i*j]
                j += 1
                continue
            odd = Xsum % 2
            #print(M, i, odd, A[i])
            if odd == A[i]:
                X[i] = 0
            else:
                X[i] = 1
    #print(N,M,X)
    if last:
        return
    if N//(M+1) == 0:
        umeru(X, M+1, True)
    else:
        umeru(X, M+1, False)

#umeru(X, 1, False)
#print(X)

M = 0
for i in range(1, N+1):
    if X[i] == 1:
        M += 1

print(M)
if M == 0:
    sys.exit()

xxx = []
for i in range(1, N+1):
    if X[i] == 1:
        xxx.append(str(X[i]))

print(' '.join(xxx))


### FIXED CODE ###

import sys

N = int(input())
Atmp = [0] + list(map(int, input().split()))
A = {}

for i,a in enumerate(Atmp):
    A[i] = a

#print(A)

X = {}

for i in reversed(list(range(1,N+1))):
    Xsum = 0
    j = 2
    while(i*j <= N):
        Xsum += X[i*j]
        j += 1
        continue
    odd = Xsum % 2
    if odd == A[i]:
        X[i] = 0
    else:
        X[i] = 1
    
M = 0
for i in range(1, N+1):
    if X[i] == 1:
        M += 1

print(M)
if M == 0:
    sys.exit()

xxx = []
for i in range(1, N+1):
    if X[i] == 1:
        xxx.append(str(i))

print(' '.join(xxx))
P,Q,R=map(int,input().split())
print(min(A+B,B+C,C+A))


### FIXED CODE ###

P,Q,R=map(int,input().split())
print(min(P+Q,Q+R,R+P))
#A,B,K = [int(i) for i in input().rstrip().split()]
A,B,K = list(map(int, input().rstrip().split()))

#nums=[i for i in range(A,B+1)]
nums=list(range(A,B+1))

if K <= len(nums)/2:
  print(*(nums[:K] + nums[-K:]),sep="\n")
else:
  print(*nums,sep="\n")


### FIXED CODE ###

A,B,K = [int(i) for i in input().rstrip().split()]

if K <= (B-A+1)/2:
  print(*( list(range(A,A+K)) + list(range(B-K+1,B+1)) ),sep="\n")
else:
  print(*list(range(A,B+1)),sep="\n")
import collections
n = int(input())
a = list(map(int, input().split()))
b = collections.deque(list)
if n % 2 == 0:
    for i, ele in enumerate(a):
        if i % 2 == 0:
            b.append(ele)
        else:
            b.appendleft(ele)
else:
    for i, ele in enumerate(a):
        if i % 2 == 0:
            b.appendleft(ele)
        else:
            b.append(ele)

print(" ".join(b))

### FIXED CODE ###

# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


def read():
    n = II()
    a = list(map(str, input().split()))
    return n, a


def solve(n, a):
    b = collections.deque([])
    if n % 2 == 0:
        for i, ele in enumerate(a):
            if i % 2 == 0:
                b.append(ele)
            else:
                b.appendleft(ele)
    else:
        for i, ele in enumerate(a):
            if i % 2 == 0:
                b.appendleft(ele)
            else:
                b.append(ele)

    ans = " ".join(list(b))
    return ans


def main():
    params = read()
    print(solve(*params))


if __name__ == "__main__":
    main()
# Binary Search Tree1
class BinaryTree():
    def __init__(self):
        self.key = None
        self.parent = None
        self.left = None
        self.right = None

def insert(z):
    global root
    y = None
    x = root
    while(x != None):
        y = x
        if z.key < x.key:
            x = x.left
        else:
            x = x.right
    z.parent = y
    if y == None:
        root = z
    elif z.key < y.key:
        y.left = z
    else:
        y.right = z

def inoder(x):
    if x == No???e: return
    else:
        node = x
        inoder(node.left)
        ino.append(str(node.key))
        inoder(node.right)

def preoder(x):
    if x == None: return
    else:
        node = x
        pre.append(str(node.key))
        preoder(node.left)
        preoder(node.right)

def show(x):
    preoder(x)
    inoder(x)
    print(" ".join(ino))
    print(" ".join(pre))


root = None
n = int(input())
T = []
cnt = 0
for i in range(n):
    L = input().split()
    if L[0] == "insert":
        T.append(BinaryTree())
        T[cnt].key = int(L[1])
        insert(T[cnt])
        cnt += 1
    else:
        pre = []
        ino = []
        show(root)

### FIXED CODE ###

#BinarySearchTree
class TreeNode():
    def __init__(self):
        self.key = None
        self.parent = None
        self.left = None
        self.right = None
    def inoder(self):
        r=[]
        if self.left:
            r += self.left.inoder()
        r += [self.key]
        if self.right:
            r += self.right.inoder()
        return r

    def preoder(self):
        r = [self.key]
        if self.left:
            r += self.left.preoder()
        if self.right:
            r += self.right.preoder()
        return r

class BinaryTree():
    def __init__(self):
        self.root = None

    def insert(self, z):
        y = None
        x = self.root
        while x != None:
            y = x
            if z.key < x.key:
                x = x.left
            else:
                x = x.right
        z.parent = y
        if y == None:
            self.root = z
        elif z.key < y.key:
            y.left = z
        else:
            y.right = z

    def show(self):
        x = self.root
        print(" " + " ".join(map(str, self.root.inoder())))
        print(" " + " ".join(map(str, self.root.preoder())))
 
 
n = int(input())
Tree = BinaryTree()
for i in range(n):
    L = input().split()
    if L[0] == "insert":
        Node = TreeNode()
        Node.key = int(L[1])
        Tree.insert(Node)
    else:
        Tree.show()
S = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']

hard = 0

for i in range(len(S)):
    moji = S[i]
    if i % 2 == 0:
        if moji not in gusu:
            hard = 1
            break
    elif i % 2 == 1:
        if moji not in kisu:
            hard = 1
            break
if hard == 0:
    print("Yes")
elif:
    print("No")
            

### FIXED CODE ###

S = input()

kisu = ['R', 'U', 'D']
gusu = ['L', 'U', 'D']

hard = 0
#S = "RDULULDURURLRDULRLR"

for i in range(len(S)):
    moji = S[i]
    if i % 2 == 1:
#        print("{} th : {} is in  Kisu(R,U,D)".format(i,moji))
        if moji not in gusu:
            hard = 1
            break
    if i % 2 == 0:
#        print("{} th : {} is in Gusu(L,U,D)".format(i,moji))
        if moji not in kisu:
            hard = 1
            break
if hard == 0:
    print("Yes")
else:
    print("No")
n = int(input())

ps = list(map(int,input().split()))

qs = list(map(int,input().split()))


a = 0
b = 0
r = 0
for i in range(n):
    if ps[i] == qs[i]:
        continue
    else:
        r = i
        break

ts = ps[r:]
ts.sort()

ns = list(itertools.permutations(ts))
m = len(ns)

for j in range(m):
    if list(ns[j]) == ps[r:]:
        a = j
        break

for l in range(m):
    if list(ns[l]) == qs[r:]:
        b = l
        break
    

print(abs(a-b))


### FIXED CODE ###

import itertools
n = int(input())

ps = list(map(int,input().split()))

qs = list(map(int,input().split()))


a = 0
b = 0
r = 0
for i in range(n):
    if ps[i] == qs[i]:
        continue
    else:
        r = i
        break

ts = ps[r:]
ts.sort()

ns = list(itertools.permutations(ts))
m = len(ns)

for j in range(m):
    if list(ns[j]) == ps[r:]:
        a = j
        break

for l in range(m):
    if list(ns[l]) == qs[r:]:
        b = l
        break
    

print(abs(a-b))
#coding:utf-8

input_line1 = raw_input()
input_line2 = raw_input()

if input_line1 + input_line2 >= 10:
	print 'error'

else:
	print input_line1 + input_line2


### FIXED CODE ###

#coding:utf-8

l = map(int, raw_input().split())

if l[0] + l[1] >= 10:
	print 'error'

else:
	print l[0] + l[1]
d t s = map(int, input().split())
if d<=t*s:
  print('Yes')
else:
  print('No')
 

### FIXED CODE ###

d, t, s = map(int, input().split())
if d<=t*s:
  print('Yes')
else:
  print('No')
import resource;
import random
# 再帰回数上弦を100000回に設定
sys.setrecursionlimit(100000)
# スタックサイズを無制限に設定
resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))

n = int(input(''))
adl = input('')

a = list(map(int,adl.split(' ')))

number = 0

mod = 7+1000000000

amari = 0

for i in range(n):
    aa = 0
    for e in range(n-i-1):
        j = i+e+1
        if i != j:
            aa = aa + a[j]
    number = number + (a[i] * aa)
amari = number % mod
print(amari)


### FIXED CODE ###

n = int(input(''))
adl = input('')

a = list(map(int,adl.split(' ')))

number = 0

mod = 1000000007

amari = 0

all_a = 0

for i in range(n):
    all_a = all_a + a[i]

for i in range(n):
    all_a = all_a - a[i]
    number = number + (a[i] * all_a)
    number = number % mod
amari = number % mod
print(amari)
import numpy as np
q = int(input())
ans = []
for _ in range(q):
    x,d,n = map(int,input().split())
    a = np.arange(x,x+n*d,d)
    ans.append(np.prod(a)%1000003)
for i in ans:
    print(i)

### FIXED CODE ###

mod = 10**6+3
max = 10**6+2
g1 = [1, 1]
for i in range( 2, max + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
def rev(a):
    return pow(a,mod-2,mod)
def f(x,d,n):
    if d==0:
        return pow(x,n,mod)
    else:
        d_r = rev(d)
        xdr = d_r * x % mod
        if xdr==0:
            return 0
        elif (xdr+n-1)>=mod:
            return 0
        else:
            return (g1[xdr+n-1]*rev(g1[xdr-1]%mod)*pow(d,n,mod))%mod
ans = []
q = int(input())
for _ in range(q):
    x,d,n = map(int,input().split())
    ans.append(f(x,d,n))
for i in ans:
    print(i)
S = input()
T = input()
cnt = 0
for x,y in  S,T:
	if x!=y:
		cnt += 1

print(cnt)

### FIXED CODE ###

S = input()
T = input()
slen = len(S)

cnt = 0
for i in  range(0,slen):
	if S[i] !=T[i]:
		cnt += 1

print(cnt)
a=int(input())
c=0
b=list(map(int,input().split()))
for i in range(a-1):
  c+=(a[i]*a[i+1])
print(c)

### FIXED CODE ###

a=int(input())
import itertools 
b=list(map(int,input().split()))
c=0
for d,e in itertools.combinations(b,2):
  c+=d*e
print(c)
S=inout()
print('Yes' if S.count('a')*S.count('b')*S.count('c')==1 else 'No')

### FIXED CODE ###

S=input()
print('Yes' if S.count('a')*S.count('b')*S.count('c')==1 else 'No')
a,b=input().split()
print(a*b)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b)
#include<bits/stdc++.h>

using namespace std;

int main(){
    long long a,b,x;
    scanf("%lld %lld %lld",&a,&b,&x);
    printf("%lld\n",(b/x)-(a/x)+(a%x==0?1:0));
    return 0;
}

### FIXED CODE ###

a,b,x=map(int,raw_input().split())
print b/x-a/x if a%x else b/x-a/x+1
N = int(input())
a = 1000 - N % 1000
if a == 1000:
    print(0)
else:
    print(a

### FIXED CODE ###

N = int(input())
a = 1000 - N % 1000
if a == 1000:
    print(0)
else:
    print(a)
def main():
    N,W = map(int, input().split())
    w,v = [0]*N,[0]*N
    for i in range(N):
        w[i],v[i] = map(int, input().split())
    # dp[i][w] := 容量をwとして荷物0~iの中から荷物を選んだ時の価値の最大値
    # 初期値dp[0][W] = 0の価値(もし0の重さがMAXを超えるなら選べない)
    dp = [[0]*(W+1) for i in range(N)]
    for x in range(W+1):
        dp[0][x] = 0 if w[0]>x else v[0]
    for i in range(N-1):
        for j in range(W+1):
            if w[i+1]<=j:
                # i+1番目を選ぶ
                dp[i+1][j] = max(dp[i+1][j], (dp[i][j-w[i+1]])+v[i+1])
            # i+1番目を選ばない
            dp[i+1][j] = max(dp[i+1][j], dp[i][j])
    print(dp[-1][W])

main()


### FIXED CODE ###

def chmin(a,b):
    if a>b: return b
    else: return a

def chmax(a,b):
    if a>b: return a
    else: return b

def main():
    N = int(input())
    h = list(map(int, input().split()))
    # 初期化
    # 初期条件
    # ループ
    # テーブルから解を得る
    INF = float('inf')
    dp = [INF] * N
    dp[0] = 0
    dp[1] = abs(h[1]-h[0])
    for i in range(N-2):
        dp[i+2] = chmin(dp[i]+abs(h[i+2]-h[i]), dp[i+1]+abs(h[i+2]-h[i+1]))
    print(dp[-1])

main()
a,b=map(int,input().split())
List=[input() for i in range(a)]

print("".join(sorted(List)))

### FIXED CODE ###

a,b,c,=map(int,input().split())
if a+b+c==17:
  print("YES")
else:
  print("NO")