Harryxun/stf_run huggingface dataset:
s = list(input())

def sum_list(S,stock):
    if len(S) == 2:
        return int(S[0]) + int(S[1]) + int(S[0]+S[1]) + stock * 2
    else:
        return sum_list(S[1:],int(S[0])+stock) + sum_list([S[0]+S[1]]+S[2:],stock)
                                                 
print(sum_list(s,0))

### FIXED CODE ###

s = list(input())

def sum_list(S,stock):
    if len(S) == 2:
        return int(S[0]) + int(S[1]) + int(S[0]+S[1]) + stock * 2
    elif len(S) == 1:
        return int(S[0])
    else:
        return sum_list(S[1:],int(S[0])+stock) + sum_list([S[0]+S[1]]+S[2:],stock)
                                                 
print(sum_list(s,0))
import statistics
n=int(input())
box=list(map(int,input().split()))
box_m=sorted(list(y-(x+1) for x,y in enumerate(box)))
median=int(statistics.median(box_m))
count=0
for x,y in enumerate(box):
    count +=abs(y-(median+x+1))
print(count)

### FIXED CODE ###

import statistics
n=int(input())
box=list(map(int,input().split()))
box_another=sorted(list(y-(x+1) for x,y in enumerate(box)))
median=int(statistics.median(box_another))
count=0
for x,y in enumerate(box):
    count +=abs(y-(x+1+median))
print(count)
n=input()
s=0
for i in range(len(n)):
  s=s+int(n[i])
print(("No","Yes")[int(n)%s==0]

### FIXED CODE ###

n=input()
s=0
for i in range(len(n)):
  s=s+int(n[i])
print(("No","Yes")[int(n)%s==0])
X = int(input())
dp = [0 for i in range(X+1)]
for i in range(100,106):
    dp[i] =1
for i in range(1,X+1):
    if dp[i-100] == 1 or dp[i-101] == 1 or dp[i-102] == 1 or dp[i-103] == 1 or dp[i-104] == 1 or dp[i-105] == 1:
        dp[i] = 1
print(dp[-1])

### FIXED CODE ###

X = int(input())
if X >= 2000:
    print(1)
elif X<= 99:
    print(0)
else:
    c = 0
    for i in range(1,20):
        if int(X//100) == i:
            if X%100 <= i*5:
                c=1
    print(c)
x,y,z=map(str,input().split(' '))
if y-x==z-y:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

a,b,c=map(int,input().split())
print("YES"if b-a==c-b else "NO")
n, k = map(int, input().split())
import math
def kai(x):
  if x == 0:
    return 1
  else:
    return math.factorial(x)
  
for i in range(1, k+1):
  if n - k  + 1 >= i:
    print(int(((kai(k-1)*kai(n-k+1)/(kai(i-1)*kai(k-i)*kai(i)*kai(n-k+1-i))) % (10**9 +7))//1))
  else:
    print(0)




### FIXED CODE ###

n, k = map(int, input().split())
import math
mod = (10**9) +7
def kai(x):
  if x == 0:
    return 1
  elif x < 0:
    return 1
  else:
    return math.factorial(x)
  
for i in range(1, k+1):
  if n - k  + 1 >= i:
    result = (kai(k-1)*kai(n-k+1))//(kai(i-1)*kai(k-i)*kai(i)*kai(n-k+1-i))
    result2 = result % mod
    print(result2)
  else:
    print(0)
x= map(input().split())

print(x.sort, sep=" ")

### FIXED CODE ###

print(*sorted(input().split(" ")))
# C - Typical Stairs

MOD = 10 ** 9 + 7
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
dp = [None] * (N + 1)

def f(i):
    if dp[i] != None:
        return dp[i]
    else:
        if i in A:
            dp[i] = 0
        elif i == 1 or i == 0:
            dp[i] = 1
        else:
            dp[i] = f(i - 1) + f(i - 2)
        return dp[i]

print(f(N) % MOD)


### FIXED CODE ###

# C - Typical Stairs

MOD = (10 ** 9) + 7
N, M = map(int, input().split())
A = [False] * (N + 1)
for _ in range(M):
    A[int(input())] = True
dp = [0] * (N + 1)
dp[0] = 1
if A[1] == False:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i] == True:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print(dp[N])
def milor(a,b):
    if a == b:
        return a
    if a > b:
        a,b = b,a
    return milor(b-a,a) + 2*a

def solve(n,x):
    res = n + milor(x,n-x)
    return res



if __name__ == '__main__':
    n,x = map(int,input().split())
    print(solve(n,x))

### FIXED CODE ###

def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)

def solve(n,x):
    res = 3 * (n - gcd(n,x))
    return res



if __name__ == '__main__':
    n,x = map(int,input().split())
    print(solve(n,x))
N = int(input())
A = [0] * N
for i in range(N):
    A[i] = int(input()) + 1

A_even = A[::2]
A_odd = A[1::2]
A_even = sorted(A_even)
A_odd = sorted(A_odd)
A_sorted = [0] * N
for i in range(N):
    if i % 2 == 0:
        A_sorted[i] = A_even[i // 2]
    else:
        A_sorted[i] = A_odd[i // 2]


class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)

    def sum(self, idx):
        s = 0
        while idx > 0:
            s += self.tree[idx]
            idx -= idx & -idx
        return s

    def add(self, idx, x):
        while idx <= self.size:
            self.tree[idx] += x
            idx += idx & -idx


bit = Bit(max(A) + 1)
ans = 0
for i in range(N):
    bit.add(A_sorted[i], 1)
    ans += i + 1 - bit.sum(A_sorted[i])

print(ans)


### FIXED CODE ###

N = int(input())
A_raw = [0] * N
for i in range(N):
    A_raw[i] = (int(input()), i)
A_raw.sort(key=lambda x: x[0])
A = [0] * N
for i in range(N):
    A[A_raw[i][1]] = i

ans = 0
for i in range(N):
    if i % 2 == 0:
        if A[i] % 2 == 1:
            ans += 1

print(ans)
import math
#平方オーダーなら収まるので平方根とって方針を分ける
n = int(input())
s = int(input())
if n == s:
  print(n + 1)
  exit(0)
def sqrt(k):
  return int(math.sqrt(k))
def digitsum(b, m):
  if m < b:
    return m
  return digitsum(b, m // b) + m % b
#√nより小さいなら
#全探索余裕 桁は多くて40程度なので
for b in range(2, sqrt(n) + 1):
  if digitsum(b, n) == s:
    print(b)
    exit(0)
#√nより大きいなら
#b^2 > n である。２桁ということ
#2桁目がpなら、1桁目はs-pである
#pb + s - p = n
#b = (n - s) // p + 1
for p in range(1, sqrt(n)):
  b = (n - s) // p + 1
  if b == 1: continue
  if digitsum(b, n) == s:
    print((n - s) // p + 1)
    exit(0)
print(-1)

### FIXED CODE ###

import math
#平方オーダーなら収まるので平方根とって方針を分ける
n = int(input())
s = int(input())
if n == s:
  print(n + 1)
  exit(0)
def sqrt(k):
  return int(math.sqrt(k))
def digitsum(b, m):
  if m < b:
    return m
  return digitsum(b, m // b) + m % b
#√nより小さいなら
#全探索余裕 桁は多くて40程度なので
for b in range(2, sqrt(n) + 1):
  if digitsum(b, n) == s:
    print(b)
    exit(0)
#√nより大きいなら
#b^2 > n である。２桁ということ
#2桁目がpなら、1桁目はs-pである
#pb + s - p = n
#b = (n - s) // p + 1
for p in range(sqrt(n), 0, -1):
  b = (n - s) // p + 1
  if b <= 1: continue
  if digitsum(b, n) == s:
    print((n - s) // p + 1)
    exit(0)
print(-1)
import numpy as np
 
N = int(input())
x_list = np.array(list(map(int, input().split()))).reshape(1,N)
count = np.sum(x_list%x_list.reshape(N,1)==0, axis=0)==1
print(np.sum(count))

### FIXED CODE ###

N = int(input())
a_list = sorted(list(map(int, input().split())))
a_max = a_list[-1]

count = [0] * (a_max+1)

for a in a_list:
  for j in range(a, a_max+1, a):
    count[j] += 1
  
ans = 0
for a in a_list:
  if count[a] == 1:
    ans += 1
print(ans)
from sys import stdin
data = stdin.readline().split()
N, M = int(data[0]), int(data[1])
a = [None] * M
fib = [None] * N
for i in range(M):
    a[i] = int(stdin.readline().rstrip())
    fib[a[i] - 1] = 0
    if i > 0 and a[i] - a[i-1] == 1:
        print(0)
        exit()
if not 1 in a:
    fib[0] = 1
    if not 2 in a:
        fib[1] = 2
    else:
        fib[1] = 0
else:
    fib[0] = 0
    fib[1] = 1
for i in range(2,N):
    if fib[i] == 0:
        continue
    else:
        fib[i] = fib[i-1] + fib[i-2]
# print(fib)
print(fib[N-1] % 1000000007)

### FIXED CODE ###

from sys import stdin
data = stdin.readline().split()
N, M = int(data[0]), int(data[1])
a = [None] * M
fib = [None] * N
if N == 1:
    print(1)
    exit()
for i in range(M):
    a[i] = int(stdin.readline().rstrip())
    fib[a[i] - 1] = 0
    if i > 0 and a[i] - a[i-1] == 1:
        print(0)
        exit()
if not 1 in a:
    fib[0] = 1
    if not 2 in a:
        fib[1] = 2
    else:
        fib[1] = 0
else:
    fib[0] = 0
    fib[1] = 1
for i in range(2,N):
    if fib[i] == 0:
        continue
    else:
        fib[i] = fib[i-1] + fib[i-2]
# print(fib)
print(fib[N-1] % 1000000007)
# S = '0011'
# S = '11011010001011'
# S = '0'
S = input()

cnt = 0


def www(s):
    global cnt

    if len(s) <= 1:
        return

    index = 0
    tmp = []
    c = 0

    while True:
        if len(s) < index + 1:
            break
        if s[index] == '0' and s[index + 1] == '1':
            index += 1
            c += 2
        else:
            tmp.append(S[index])
        index += 1
    cnt += c

    if 0 < c:
        www(tmp)


www(S)
print(cnt)


### FIXED CODE ###

# S = '0011'
# S = '11011010001011'
# S = '0'
S = input()

red = 0
blue = 0

for i in S:
    if i == '0':
        red += 1
    else:
        blue += 1

print(min(red,blue) * 2)
n,m=map(int,input().split());d={0:1}
for i in input().split():d.get(int(i)%m,0);d[int(i)%m]+=1
print(sum(map(lambda x:x*(x-1)//2,d.values())))

### FIXED CODE ###

from itertools import accumulate
from collections import Counter
import math

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

n,m=map(int,input().split())
s=list(map(lambda x:x%m,list(accumulate(list(map(int,input().split()))))))
s.append(0)
#print(s)
d=Counter(s)
#print(d)
ans=0
for i in d:
    if d[i]>=2:
        ans+=combinations_count(d[i],2)
print(ans)
s = input()
t = 0
for i in range(len(s)):
  if s[i] != s[::-1][i]:
    t += 1
ptint(t)

### FIXED CODE ###

s = input()
t = 0
for i in range(len(s)):
  if s[i] != s[::-1][i]:
    t += 1
print(t//2)
n=int(input())
ans=float(0)
if n%2=0:
    ans=1/2
else:
    ans=(n//2)+1

print(ans)


### FIXED CODE ###

n=float(input())
ans=float(0)
if n%2==0:
    ans=1/2
else:
    ans=((n//2)+1)/n

print(ans)
import sys
from collections import deque, defaultdict
import copy
import bisect
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
import math

S = input()
amari = [1, 10, 9, 12, 3, 4]
kurai = 0
hatena = []
base = 0
for i in range(len(S)):
	#print(S[len(S) - 1 - i])
	if S[len(S) - 1 - i] == '?':
		hatena.append(kurai)
	else:
		base += (int(S[len(S) - 1 - i])*amari[i % 6])
		base = base % 13
	kurai += 1

#print(base, hatena)
count13 = [0]*13
count13[base]+=1
for kurai in hatena:
	countnow = [0]*13
	for num in range(10):
		x = num * amari[kurai % 6]
		for i in range(13):
			y = (i + x) % 13
			countnow[y] += count13[i]
	for i in range(13):
		countnow[i] = countnow[i] % 1000000007
	count13 = copy.deepcopy(countnow)

print(count13[5])

### FIXED CODE ###


import sys
from collections import deque, defaultdict
import copy
import bisect
sys.setrecursionlimit(10 ** 9)
import math

S = input()
amari = [1, 10, 9, 12, 3, 4]
kurai = 0
hatena = []
base = 0
for i in range(len(S)):
	#print(S[len(S) - 1 - i])
	if S[len(S) - 1 - i] == '?':
		hatena.append(kurai)
	else:
		base += (int(S[len(S) - 1 - i])*amari[i % 6])
		base = base % 13
	kurai += 1

#print(base, hatena)
count13 = [0]*13
count13[base]+=1
for kurai in hatena:
	countnow = [0]*13
	for num in range(10):
		x = num * amari[kurai % 6]
		for i in range(13):
			y = (i + x) % 13
			countnow[y] += count13[i]
	for i in range(13):
		countnow[i] = countnow[i] % 1000000007
	count13 = copy.deepcopy(countnow)

print(count13[5])
S = input (　)

if S == 'sun':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print('1')

    

### FIXED CODE ###

S = input ()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
S = int(input())
h = ??????????±????????¨????
m = ???????±????????¨????
s = ?§?????±????????¨????
print(h,m,s, sep=":")

### FIXED CODE ###

S = int(input())
h = S // 3600
m = S % 3600 // 60
s = S % 60
print(h, m, s, sep=':')
from collections import Counter


def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    ca = Counter(a)
    cb = Counter(b)
    for k in cb.keys():
        if cb[k] > n - ca[k]:
            print("No")
            return
    raise Exception


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import Counter
import numpy as np


def main():
    n = int(input())
    a = np.array([int(i) for i in input().split()])
    b = np.array([int(i) for i in input().split()])
    ca = Counter(a)
    cb = Counter(b)
    for k in cb.keys():
        if cb[k] > n - ca[k]:
            print("No")
            return
    while any(a == b):
        s = max(ca[k] for k in cb.keys())
        b = np.roll(b, s)
    print("Yes")
    print(*b)


if __name__ == '__main__':
    main()
r,d,x = map(int,input().split())
for i in range(10)
    x = r * x - d
    print(x)

### FIXED CODE ###

r,d,x = map(int,input().split())
for i in range(10):
    x = r * x - d
    print(x)
class Dice:
    def __init__(self):
        self.omote=1
        self.sita=2
        self.migi=3
        self.ue=4
        self.hidari=5
        self.ura=6

    def North(self):
        self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura

    def East(self):
        self.omote,self.hidari,self.ura,self.migi=self.hidari,self.ura,self.migi,self.omote

    def West(self):
        self.omote,self.migi,self.ura,self.hidari=self.migi,self.ura,self.hidari,self.omote

    def South(self):
        self.omote,self.ue,self.ura,self.sita=self.ue,self.ura,self.sita,self.omote

    def Right(self):
        self.sita,self.migi,self.ue,self.hidari=self.migi,self.ue,self.hidari,self.sita

    def Left(self):
        self.sita,self.hidari,self.ue,self.migi=self.hidari,self.ue,self.migi,self.sita


while(True):
    n=int(input())
    if n==0:
        break
    sum=0
    dice=Dice()
    dice_def={"North":dice.North,"East":dice.East,"South":dice.South,"West":dice.West,"Right":dice.Right,"Left":dice.Left}
    for i in range(n):
        dice_def[input()]()
        sum+=dice.omote
    print(sum)

### FIXED CODE ###

class Dice:
    def __init__(self):
        self.omote=1
        self.sita=2
        self.migi=3
        self.ue=5
        self.hidari=4
        self.ura=6

    def North(self):
        self.omote,self.ue,self.ura,self.sita=self.sita,self.omote,self.ue,self.ura

    def East(self):
        self.omote,self.hidari,self.ura,self.migi=self.hidari,self.ura,self.migi,self.omote

    def West(self):
        self.omote,self.migi,self.ura,self.hidari=self.migi,self.ura,self.hidari,self.omote

    def South(self):
        self.omote,self.ue,self.ura,self.sita=self.ue,self.ura,self.sita,self.omote

    def Right(self):
        self.sita,self.migi,self.ue,self.hidari=self.migi,self.ue,self.hidari,self.sita

    def Left(self):
        self.sita,self.hidari,self.ue,self.migi=self.hidari,self.ue,self.migi,self.sita

n=int(input())
while(n!=0):
    sum=1
    dice=Dice()
    dice_def={"North":dice.North,"East":dice.East,"South":dice.South,"West":dice.West,"Right":dice.Right,"Left":dice.Left}
    for i in range(n):
        dice_def[input().strip()]()
        sum+=dice.omote
    print(sum)
    n=int(input())
N = int(input())
A = list(map(int, input().split()))
A.sort()
def main():
    if A[0] == N % 2:
        print(0)
        return 0
    if A[0] == 0:
        del A[0]
    if A[0] == 0:
        print(0)
        return 0
    i = 1
    while True:
        if i >= len(A):
            break
        if len(A) % 2 != 0:
            print(0)
            return 0
        if A[i] != A[i - 1]:
            print(0)
            return 0
        i += 2
    i = 2
    while True:
        if i >= len(A):
            break
        if A[i] == A[i - 1]:
            print(0)
            return 0
        i += 2
    print(pow(2, len(A) // 2) % 1000000007)
main()

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
def main():
    if A[0] == N % 2:
        print(0)
        return 0
    if len(A) == 1 and A[0] == 0:
        print(1)
        return 0
    elif len(A) == 1:
        print(0)
        return 0
    if A[0] == 0:
        del A[0]
    if A[0] == 0:
        print(0)
        return 0
    i = 1
    while True:
        if i >= len(A):
            break
        if len(A) % 2 != 0:
            print(0)
            return 0
        if A[i] != A[i - 1]:
            print(0)
            return 0
        i += 2
    i = 2
    while True:
        if i >= len(A):
            break
        if A[i] == A[i - 1]:
            print(0)
            return 0
        i += 2
    print(pow(2, len(A) // 2) % 1000000007)
main()
s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
	print("AMBIGUOUS")
elif 1 <= left and left <= 12:
	print("MMYY")
elif 1 <= rihgt and right <= 12:
	print("YYMM")
else:
	print("NA")

### FIXED CODE ###

s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
  print("AMBIGUOUS")
elif 1 <= left and left <= 12:
  print("MMYY")
elif 1 <= right and right <= 12:
  print("YYMM")
else:
  print("NA")
a,b,c = list(map(int,input()))
if a+c ==c:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c = list(map(int,input().split()))
if a+c == 2*b:
  print("YES")
else:
  print("NO")
from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    N = int(input())

    E = {}
    for i in range(0, N+1):
    E[i] = []
    for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    E[a].append(b)
    E[b].append(a)

    dp = [[0 for i in range(2)] for j in range(100100)]

    def dfs(c, p):
    dp[c][0], dp[c][1] = 1, 1
    for to in E[c]:
        if to != p:
            dfs(to, c)
            dp[c][0] *= dp[to][0] + dp[to][1]
            dp[c][1] *= dp[to][0]

    dfs(0, -1)

    ans = (dp[0][0] + dp[0][1]) % MOD
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from heapq import heappush, heappop
import collections
import math
import heapq
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def main():
    N = int(input())
    E = {}
    for i in range(0, N+1):
        E[i] = []
    for i in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        E[a].append(b)
        E[b].append(a)

    dp = [[0 for i in range(2)] for j in range(100100)]

    def dfs(c, p):
        dp[c][0], dp[c][1] = 1, 1
        for to in E[c]:
            if to != p:
                dfs(to, c)
                dp[c][0] *= dp[to][0] + dp[to][1]
                dp[c][1] *= dp[to][0]

    dfs(0, -1)

    ans = (dp[0][0] + dp[0][1]) % MOD
    print(ans)


if __name__ == '__main__':
    main()
from collections import defaultdict
S = input()

class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0] * (n + 1)

    def update(self, i, v):
        while i <= self.n:
            self.bit[i] += v
            i += i & -i
            
    def query(self, i):
        ret = 0
        while i > 0:
            ret += self.bit[i]
            i -= i & -i
            
        return ret

d = defaultdict(list)
for i, v in enumerate(S):
    d[v].append(i + 1)

if sum(len(l) % 2 != 0 for l in d.values()) > 1:
    print(-1)
    exit()

N = len(S)
ctr = []
key_map = [-1] * (N + 1)

for k, v in d.items():
    t = len(v)
    if t % 2  == 1:
        key_map[v[t % 2]] = N // 2 + 1

    for j in range(t // 2):
        ctr.append((v[j], v[-j - 1]))
        
ctr.sort()

for i, (l, r) in enumerate(ctr):
    key_map[l] = i + 1
    key_map[r] = N - i

tree = BIT(N)
ans = 0
for i, v in enumerate(key_map[1:]):
    ans += i - tree.query(v)
    tree.update(v, 1)
print(ans)


### FIXED CODE ###

from collections import defaultdict
S = input()

class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0] * (n + 1)

    def update(self, i, v):
        while i <= self.n:
            self.bit[i] += v
            i += i & -i
            
    def query(self, i):
        ret = 0
        while i > 0:
            ret += self.bit[i]
            i -= i & -i
            
        return ret

d = defaultdict(list)
for i, v in enumerate(S):
    d[v].append(i + 1)

if sum(len(l) % 2 != 0 for l in d.values()) > 1:
    print(-1)
    exit()

N = len(S)
ctr = []
key_map = [-1] * (N + 1)

for k, v in d.items():
    t = len(v)
    if t % 2  == 1:
        key_map[v[t // 2]] = N // 2 + 1

    for j in range(t // 2):
        ctr.append((v[j], v[-j - 1]))
        
ctr.sort()

for i, (l, r) in enumerate(ctr):
    key_map[l] = i + 1
    key_map[r] = N - i

tree = BIT(N)
ans = 0
for i, v in enumerate(key_map[1:]):
    ans += i - tree.query(v)
    tree.update(v, 1)
print(ans)
n,m,x=map(int,input().split())
l=[]
while n>0:
    for i in range(n):
        a=list(map(int,input().split()))
        l.append(a)
        if a[i]

### FIXED CODE ###

N, M = map(int, input().split())
link = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited = [False for i in range(N)]
result = [0] * N
Q = [0]
visited[0] = True
#Qに要素がなくなるまで
while Q:
    #一番上の要素をpop
    v = Q.pop(0)
    for i in link[v]:
        if visited[i] == False:
            visited[i] = True
            result[i] = v
            Q.append(i)
print("Yes")
for i in range(1, N):
    print(result[i] + 1)
a,b=map(int,input().split())
if 0 == ((a*b)%2):
  print('even')
else:
  print('Odd')

### FIXED CODE ###

s=str(input())
print(s.count('1'))
A,B=input().split(" ")
print("Impossible" if A*B*(A+B)%3 else "Possible")

### FIXED CODE ###

A,B=map(int,input().split(" "))
print("Impossible" if A*B*(A+B)%3 else "Possible")
S = input()
len(S)=p
t=0
for n in range(p):
  if S[n]=S[p-n-1]:
    continue
  else:
    t+=1
print(t/2)

### FIXED CODE ###

S = input()
p=len(S)
t=0
for n in range(p):
  if S[n]!=S[p-n-1]:
    t+=1
print(int(t/2))
from collections import Counter, deque

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A_cn = Counter(A)
B_cn = Counter(B)
AB_cn = Counter(A+B)
if AB_cn.most_common()[0][1] > N:
    print("No")
else:
    print("Yes")
    b = deque(B)
    ans_dict = {}
    cntr = 0
    while b:
        if cntr not in ans_dict:
            c = b.pop()
            if A[cntr] != c:
                ans_dict[cntr] = c
            else:
                b.pushleft(c)
        cntr += 1
        cntr %= N
    ans = []
    for i in range(N):
        ans += [ans_dict[i]]
    print(*ans)



### FIXED CODE ###

from collections import Counter, deque

N = int(input())
A = list(map(int, input().split())) + [N+1]
B = list(map(int, input().split())) + [N+1]
C = [0]
D = [0]

AB_cn = Counter(A+B)
if AB_cn.most_common()[0][1] > N:
    print("No")
else:
    print("Yes")
    for i in range(N+1):
        if len(C) != A[i]:
            C.extend([i]*(A[i]-len(C)))
        if len(D) != B[i]:
            D.extend([i]*(B[i]-len(D)))
    ans = 0
    for i in range(N):
        curr = C[i+1] - D[i]
        ans= max(curr, ans)
    B = B[:-1]
    ans = [B[(i-ans)%N] for i in range(N)]
 
    print(*ans)
temp=list(map(int, input().split()))
S=input()
K=int(temp[1]-1)

if S[K]=='A':
  S[K]='a'
elif S[K]=='B':
  S[K]='b'
else:
  S[K]='c'
  
print(S)

### FIXED CODE ###

temp=list(map(int, input().split()))
S=list(input())
K=int(temp[1]-1)

if S[K]=='A':
  S[K]='a'
elif S[K]=='B':
  S[K]='b'
else:
  S[K]='c'
  
print("".join(S))
n=int(input())
nums=[]
for i in range(n):
    nums.appemd(int(input()))
for i in range(1,n):
    v=nums[i]
    j=i-1
    while j>=0 and nums[j]>v:
        nums[j+1]=nums[j]
        j-=1
    nums[j+1]=v
print(nums[n-1]-nums[0])


### FIXED CODE ###

import sys
  
input()
minv = int(input())
maxv = -1000000000
  
for r in map(int,sys.stdin.readlines()):
  m = r-minv
  if maxv < m: 
    maxv = m
    if m < 0: minv = r
  elif m < 0: minv = r
  
print(maxv)