Harryxun/stf_run huggingface dataset:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import copy

x = ['Front', 'Right', 'Back', 'Left']
y = ['Top', 'Front', 'Bottom', 'Back']
z = ['Top', 'Left', 'Bottom', 'Right']


def turn(dice, direction):
    turned_dice = copy.deepcopy(dice)
    # x?????????
    if direction == 'Right':
        for i in range(4):
            turned_dice[x[i]] = dice[x[(i+1)%4]]
    if direction == 'Left':
        for i in range(4):
            turned_dice[x[i]] = dice[x[(i-1)%4]]

    # y?????????
    if direction == 'North':
        for i in range(4):
            turned_dice[y[i]] = dice[y[(i+1)%4]]
    if direction == 'South':
        for i in range(4):
            turned_dice[y[i]] = dice[y[(i-1)%4]]

    # z?????????
    if direction == 'East':
        for i in range(4):
            turned_dice[z[i]] = dice[z[(i+1)%4]]
    if direction == 'West':
        for i in range(4):
            turned_dice[z[i]] = dice[z[(i-1)%4]]

    return turned_dice

if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        dice = {'Top': 1, 'Front': 2, 'Right': 3,
                'Left': 4, 'Back': 5, 'Bottom': 6}

        ret = 1
        for i in range(n):
            dice = turn(dice, input())
            ret += dice['Top']

        print(ret)

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import copy

x = ['Front', 'Right', 'Back', 'Left']
y = ['Top', 'Front', 'Bottom', 'Back']
z = ['Top', 'Left', 'Bottom', 'Right']


def turn(dice, direction):
    turned_dice = copy.deepcopy(dice)
    # x?????????
    if direction == 'Right':
        for i in range(4):
            turned_dice[x[i]] = dice[x[(i+1)%4]]
    if direction == 'Left':
        for i in range(4):
            turned_dice[x[i]] = dice[x[(i-1)%4]]

    # y?????????
    if direction == 'North':
        for i in range(4):
            turned_dice[y[i]] = dice[y[(i+1)%4]]
    if direction == 'South':
        for i in range(4):
            turned_dice[y[i]] = dice[y[(i-1)%4]]

    # z?????????
    if direction == 'East':
        for i in range(4):
            turned_dice[z[i]] = dice[z[(i+1)%4]]
    if direction == 'West':
        for i in range(4):
            turned_dice[z[i]] = dice[z[(i-1)%4]]

    return turned_dice

if __name__ == '__main__':
    while True:
        n = int(input())
        if n == 0:
            break
        dice = {'Top': 1, 'Front': 2, 'Right': 3,
                'Left': 4, 'Back': 5, 'Bottom': 6}

        ret = 1
        for i in range(n):
            dice = turn(dice, input())
            ret += dice['Top']

        print(ret)
N, A, B, K = map(int, input().split())
MOD = 998244353

fact = [1]*(N+1)
rev = [1]*(N+1)
for i in range(1, N+1):
    fact[i] = fact[i-1]*i % MOD
    rev[i] = pow(fact[i], MOD-2, MOD)

ans = 0
for a in range(N+1):
    if (K - a*A) >= 0 and (K - a*A) % B == 0:
        b = (K - a*A) // B
        ans += rev[a]*rev[N-a] * rev[b]*rev[N-b]
        ans %= MOD
ans *= fact[N]*fact[N]
ans %= MOD
print(ans)



### FIXED CODE ###

N, A, B, K = map(int, input().split())
MOD = 998244353

fact = [1]*(N+1)
rev = [1]*(N+1)
for i in range(1, N+1):
    fact[i] = fact[i-1]*i % MOD
    rev[i] = pow(fact[i], MOD-2, MOD)

ans = 0
for a in range(N+1):
    if (K - a*A) >= 0 and (K - a*A) % B == 0:
        b = (K - a*A) // B
        if not 0 <= b <= N:
            continue
        ans += rev[a]*rev[N-a] * rev[b]*rev[N-b]
        ans %= MOD
ans *= fact[N]*fact[N]
ans %= MOD
print(ans)
s=list(input())
print(List.count("1"))

### FIXED CODE ###

s=list(input())
print(s.count("1"))
n,k=map(int,input().split())
ans=0
hlist=[int(input()) for i in range(n)]
for height in hlist:
  if height>=k:
    ans+1
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
ans=0
hlist=list(map(int,input().split()))
for height in hlist:
  if height>=k:
    ans+=1
print(ans)
if input() == 1:
print(0)
else:
print(1)

### FIXED CODE ###

if int(input())==1:
    print(0)
else:
    print(1)
N = int(input())
ans = 0
for i in range(1, N+1):
	return ans += i
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1, N+1):
	ans += i
print(ans)
n=input()
result=''
for i in n:
    if i==1:
        result+=9
    else:
        result+=1
    print(result)

### FIXED CODE ###

n=input()
result=''
for i in n:
    if i=='1':
        result+='9'
    else:
        result+='1'
print(result)
import fractions as math

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

#同じく最小公倍数
def lcmlist(l):
    a = l[0]
    for i in range(len(l)):
        a = int(a)
        a = a*l[i]/math.gcd(a,l[i])
    return int(a)

if n == 1:
    print(list1[0]-1)
    exit()

lcm = lcmlist(list1)
lcm -= 1
ans = 0
for i in list1:
    ans += lcm%i

print(ans)

### FIXED CODE ###

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

ans = 0
for i in list1:
    ans += i-1
print(ans)
import numpy as np
from itertools import combinations, permutations

n = int(input())
ls = [list(map(int, input().split())) for _ in range(n)]


def mean_dis(data):
    comb = permutations(data, n)
    sum = 0
    count = 0
    for c in comb:
        count += 1
        for i in range(1, len(c)):
            _c = np.array([c[i-1], c[i]])
            euclid = np.sqrt(np.sum((_c[0]-_c[1]) ** 2))
            sum += euclid
    return sum/count


print(mean_dis(ls))

### FIXED CODE ###

import numpy as np
from itertools import combinations, permutations

n = int(input())
ls = [list(map(int, input().split())) for _ in range(n)]


def mean_dis(data):
    comb = permutations(data, n)
    sum = 0
    count = 0
    for c in comb:
        count += 1
        for i in range(1, len(c)):
            _c = np.array([c[i-1], c[i]])
            euclid = np.sqrt(np.sum((_c[0]-_c[1]) ** 2))
            sum += euclid
    return sum/count


def mean_dis2(data, n):
    comb = combinations(data, 2)
    all_dis = 0
    for c in comb:
        _c = np.array([c[0], c[1]])
        euclid = np.sqrt(np.sum((_c[0] - _c[1]) ** 2))
        all_dis += euclid

    return (all_dis*2)/n

print(mean_dis2(ls, n))
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)
def gcd(n1,n2):
    if n1 > n2:
        n1,n2 = n2,n1
    if n2 % n1 == 0:return n1
    else: return gcd(n2%n1,n1)
n = int(input())
if n == 1:
    print(int(input()))
    sys.exit()
t = [int(input()) for i in range(n)]
check = t[0]*t[1]//gcd(t[0],t[1])
for i in range(n-2):
    check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check))
N = int(input())
A = list(map(int,input().split()))
ans = 0
i=0
if A in 0:
  print(0)
else:
  while N > i:
  	if ans > 10**18:
    	print(-1)
        exit()
    else:
      ans *= A[i]
      i += 1
print(ans)

### FIXED CODE ###

##169

##B
N = int(input())
A = list(map(int,input().split()))
ans = 1
i=0
if 0 in A:
  print(0)
else:
  while N > i:
    if ans <= 10**18:
        ans *= A[i]
        i += 1
    else:
        ans = -1
        break
  
  if ans > 10**18:
        print(-1)
  else:
    print(ans)
N,K,Q=map(int,input().split())
P=[K for _ in range(N)]
for i in range(N):
  P[int(input())-1]+=1
P=[j-Q for j in P]
for k in range(Q):
  if P[i]>0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

N,K,Q=map(int,input().split())
P=[K for _ in range(N)]
for i in range(Q):
  P[int(input())-1]+=1
P=[j-Q for j in P]
for k in range(N):
  if P[k]>0:
    print("Yes")
  else:
    print("No")
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


def f(i, j):
    if F[i][j]:
        return F[i][j]
    else:
        Fij = modFacts[i + j]
        Ii = invs[i]
        Ij = invs[j]
        rst = (Fij * Ii * Ij) % MOD
        F[i][j] = rst
        F[j][i] = rst
        return rst


r1, c1, r2, c2 = map(int, input().split())
modFacts, invs = prepare(max(r1, c1, r2, c2) * 2)


F = [[0] * (max(r2 + 1, c2 + 1)) for _ in range(max(r2 + 1, c2 + 1))]
ans = 0
for x in range(r1, r2 + 1):
    for y in range(c1, c2 + 1):
        tmp = f(x, y)
        ans += tmp
        ans %= MOD

print(ans)


### FIXED CODE ###

MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return modFacts, invs


def f(i, j):
    Fij = modFacts[i + j]
    Ii = invs[i]
    Ij = invs[j]
    rst = (Fij * Ii * Ij) % MOD
    return rst


def g(r1, r2, y):
    rst = 0
    for x in range(r1, r2 + 1):
        rst += f(x + 1, y)
        rst %= MOD
    return rst


r1, c1, r2, c2 = map(int, input().split())
modFacts, invs = prepare(max(r1, c1, r2, c2) * 2 + 1)


ans = g(r1, r2, c2) - g(r1, r2, c1 - 1)


print(ans % MOD)
#-*- coding: utf-8 -*-
a,b,n = map(int,input().split())
if n>=b:
    n = b - 1
    print(int(a*n/b)-(a*n/b))
    exit():
else:
    print(int(a*n/b))
    exit():

### FIXED CODE ###

#-*- coding: utf-8 -*-
import math
a,b,n = map(int,input().split())
x = min(b-1,n)
ans = math.floor(a*x//b)-a*math.floor(x/b)
print(ans)
x1,y1,x2,y2=map(int,input().split())
Dist = abs(y1-y2)**2+abs(x1-x2)**2
dist = Dist**0.5
for i in range(-1000,1000):
  if Dist*(i-x2)**2==Dist*(y2-y1)**2:
    if i < x2:
      x3 = i
      y3 = y2 - (x2-x1)*(x3-x2)//(y2-y1)
  if Dist*(i-x1)**2==Dist*(y2-y1)**2:
    if i < x1:
      x4 = i
      y4 = y1 - (x2-x1)*(x4-x1)//(y2-y1)
print(x3,y3,x4,y4)

### FIXED CODE ###

x1,y1,x2,y2=map(int,input().split())
if x2 >= x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
elif x2 < x1 and y2 >= y1:
  x3=x2-abs(y2-y1)
  x4=x1-abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
elif x2 < x1 and y1 >= y2:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2-abs(x2-x1)
  y4=y1-abs(x2-x1)
else:
  x3=x2+abs(y2-y1)
  x4=x1+abs(y2-y1)
  y3=y2+abs(x2-x1)
  y4=y1+abs(x2-x1)
print(x3,y3,x4,y4)
from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

def max_ave():
    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    sort_v = sorted(v, reverse=True)

    # 平均の最大値を求める
    sum_A = 0
    for i in range(A):
        sum_A += sort_v[i]
    max_ave_v = sum_A / A

    print(max_ave_v)

    # 選び方を求める
    V = sort_v[:A]
    num = v.count(min(V))
    a = V.count(min(V))
    cnt = 0
    if max(V) == min(V):
        if num == 1:
            print(1)
            exit()
        for i in range(A,B+1):
            cnt += combinations_count(num,i)
    else:
        cnt = combinations_count(num,a)
    
    print(cnt)

max_ave()

### FIXED CODE ###

from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

def max_ave():
    N, A, B = map(int, input().split())
    v = list(map(int, input().split()))
    sort_v = sorted(v, reverse=True)

    # 平均の最大値を求める
    sum_A = 0
    for i in range(A):
        sum_A += sort_v[i]
    max_ave_v = sum_A / A

    print(max_ave_v)

    # 選び方を求める
    V = sort_v[:A]
    num = v.count(min(V))
    a = V.count(min(V))
    cnt = 0
    if max(V) == min(V):
        for i in range(A,B+1):
            if num < i:
                continue
            cnt += combinations_count(num,i)
    else:
        cnt = combinations_count(num,a)
    
    print(cnt)

max_ave()
# coding: utf-8
# Your code here!

X = list(input())
num = len(X)
stack = [X[0]]

for i in range(1, num):
    if X[i] == "S":
        stack.append("S")
    else:
        if stack[-1] == "T" or stack[0] == "":
            stack.append("T")
        else:
            stack.pop(-1)
print(len(stack))


### FIXED CODE ###

# coding: utf-8
# Your code here!

X = list(input())
num = len(X)
stack = []

for i in X:
    if i == "S":
        stack.append(i)
    else:
        if stack == [] or stack[-1] == "T":
            stack.append(i)
        else:
            stack.pop()
print(len(stack))
a,b = map(int,input().split())
b1 = 0
b2 = 0
s = 0
s1 = 0
s2 = 0
t = 0
t1 = 0
u = 0
if b>=10000:
	s = b / 10000
	b1 = b - s*10000
    if 5000<=b1<10000:
        b2 = b1 - 5000
        s1 = b2 / 1000
        if (s + 1 + s1) <= a:
            print(s,1,s1)
        else:
            print(-1,-1,-1)
elif 5000<=b<10000:
    t = b / 5000
    b1 = b - t*5000
    t1 = b1 / 1000
    if (t + t1) <= a:
        print(0,t,t1)
    else:
      print(-1,-1,-1)
elif b<5000:
    u = b / 1000
    if u <= a:
        print(0,0,u)
    else:
        print(-1,-1,-1)
    

### FIXED CODE ###

N,Y = map(int,input().split())
c = 0
for i in range(0,N+1):
    for j in range(0,N+1):
        c = ((Y-(10000*i+5000*j))/1000)
        if c.is_integer and c >= 0 and i+j+c == N:
            d = int(c)
            print(i,j,d)
            exit()
print(-1,-1,-1)
while true:
H,W = map(int,raw_input().split())

 if W==0 and H==0 :
    break
 
 else :
 print ('#' * W + '\n')

 print (('#'+ '.'*(W-2)+ '#'+'\n')*(H-2))
 print ('#'*W + '\n')

### FIXED CODE ###

while 1:
    H, W = map(int,raw_input().split())
    if H + W == 0: break
    print ('#' * W)
    for h in range(H-2):
        print ('#' + '.' * (W - 2) + '#')
    print ('#' * W + '\n')
x = int(raw_input())
print (x * x * x)

### FIXED CODE ###

import sys

x = int(input())
print (x * x * x)
n = input()
print(len(set(list(map(int, [input() for i in range(n+1)])))))

### FIXED CODE ###

n = int(input())
print(len(set(list(map(int, [input() for i in range(n)])))))
import numpy as np
N, K = map(int, input().split())
A = list(map(int, input().split()))

r=sum(A[0:K])
re=r
for i in range(N-K):
    r=r+A[K+i]-A[i]
    if r > re:
        re=r
        
print((re+K)/2)


### FIXED CODE ###

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

hoge=0
for i in range(K):
    hoge += A[i]

re=hoge
for i in range(N-K):
    hoge=hoge+A[K+i]-A[i]
    if hoge >= re:
        re=hoge
        
print((re+K)/2)
a, b, k = map(int, input().split())
ans = []
for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])

### FIXED CODE ###

a, b, k = map(int, input().split())
ans = []
for i in range(1, min(a, b)+1):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])
def resolve():
    N,K = map(int,input().split())
    A = [int(i)-1 for i in input().split()]
    visited =[False]*N
    steps = [K for i in range(N)]

    current = 0
    while True:

        if K == 0:
			print(current+1)
            return
        if not visited[current]:
            visited[current]=True
            steps[current]=K
            current=A[current]
            K-=1
        else:
            K= K % (steps[current]-K)
            break
    
    while K != 0:

        current= A[current]
        K-=1
    print(current+1)




if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    N,K = map(int,input().split())
    A = [int(i)-1 for i in input().split()]
    visited =[False]*N
    steps = [K for i in range(N)]

    current = 0
    while True:

        if K == 0:
            print(current+1)
            return
        if not visited[current]:
            visited[current]=True
            steps[current]=K
            current=A[current]
            K-=1
        else:
            K= K % (steps[current]-K)
            break
    
    while K != 0:

        current= A[current]
        K-=1
    print(current+1)




if __name__ == "__main__":
    resolve()
a b = input()

print 2*(a+b) a*b

### FIXED CODE ###

a,b=map(int,raw_input().split()) #korenazo
print a*b , 2*(a+b)
def simple_knapsack(N: int, W: int, items: list) -> int:
    # dp[n][w] は n~N 番目の品物を利用して重さが w 以下となるときの
    # 最大価値
    dp = [[0] * (W+1) for _ in range(N+1)]

    for i, (iw, iv) in enumerate(items):
        for w in range(W+1):
            if w < iw:
                dp[N-i-1][w] = dp[N-i][w]
            else:
                dp[N-i-1][w] = max(dp[N-i][w], dp[N-i][w-iw]+iv)
    return dp[0][W]


if __name__ == "__main__":
    N = 0
    N, W = map(int, input().split())
    items = [tuple(map(int, input().split())) for _ in range(N)]
    ans = simple_knapsack(N, W, items)
    print(ans)


### FIXED CODE ###

def simple_knapsack(N: int, W: int, items: list) -> int:
    w0 = items[0][0]
    d = {w0+i: [] for i in range(4)}
    for w, v in items:
        d[w].append(v)

    s = {}
    for k, values in d.items():
        s[k] = [0] * (len(values)+1)
        for i, v in enumerate(sorted(values, key=lambda x: -x)):
            s[k][i + 1] = s[k][i] + v

    w0, w1, w2, w3 = w0, w0 + 1, w0 + 2, w0 + 3

    max_value = 0
    for i1 in range(len(s[w0])):
        if W < w0 * i1:
            break
        for i2 in range(len(s[w1])):
            if W < w0 * i1 + w1 * i2:
                break
            for i3 in range(len(s[w2])):
                if W < w0 * i1 + w1 * i2 + w2 * i3:
                    break
                for i4 in range(len(s[w3])):
                    if W < w0 * i1 + w1 * i2 + w2 * i3 + w3 * i4:
                        break
                    max_value = max(
                        max_value, s[w0][i1] + s[w1][i2] + s[w2][i3] + s[w3][i4])

    return max_value


if __name__ == "__main__":
    N = 0
    N, W = map(int, input().split())
    items = [tuple(map(int, input().split())) for _ in range(N)]
    ans = simple_knapsack(N, W, items)
    print(ans)
a, b. c = map(int, input().split())
i = a
j = 0
if(a <= i and i <= b) :
  if(c % i == 0) :
    i += 1
    j += 1
  else :
    i += 1
else :
  print(j)



### FIXED CODE ###

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

for i in range(a, b + 1) :
    if c % i == 0 :
        s += 1
        
print(s)
ans=10**10
n=int(input())
w=list(map(int,input().split()))
for i in range(1,n):
    ans=min(ans,abs(sum(w[:i])-sum(w[i:])))

print(ans)AC

### FIXED CODE ###

ans=10**10
n=int(input())
w=list(map(int,input().split()))
for i in range(1,n):
    ans=min(ans,abs(sum(w[:i])-sum(w[i:])))

print(ans)
from sys import stdin
n,k = map(int,stdin.readline().split())
arr = sorted(list(map(int,stdin.readline().split())),key=lambda x:abs(x))
mod = 10**9+7
pos,neg = [],[]
for i in arr:
    if i>=0:
        pos.append(i)
    else:
        neg.append(i)
if not len(pos):
    ans = 1
    if k%2:
        for i in range(k):
            ans *= neg[i]
            ans %= mod
    else:
        for i in range(k):
            ans *= neg[-1-i]
            ans %= mod
else:
    ans = 1
    i=len(pos)-1
    j=len(neg)-1
    val = 0
    if n==k:
        for x in arr:
            ans *= x
            ans %= mod
    elif k==1:
        ans = pos[i]%mod
    else:
        while val != k-2:
            if i == 0:
                ans *= neg[j]
                j -= 1
            elif j == 0:
                ans *= pos[i]
                i -= 1
            else:
                if pos[i]>neg[j]:
                    ans *= pos[i]
                    i -= 1
                else:
                    ans *= neg[j]
                    j -= 1
            ans %= mod
            val += 1
        if (j-len(neg)+1)%2:
            ans *= pos[i]*neg[j]
        else:
            if i==0:
                ans *= neg[j]*neg[j-1]
            elif j==0:
                ans *= pos[i]*pos[i-1]
            else:
                ans *= max(pos[i]*pos[i-1],neg[j]*neg[j-1])
        ans %= mod
print(ans)


### FIXED CODE ###

from sys import stdin
n,k = map(int,stdin.readline().split())
arr = sorted(list(map(int,stdin.readline().split())),key=lambda x:abs(x))
mod = 10**9+7
pos,neg = [],[]
for i in arr:
    if i>=0:
        pos.append(i)
    else:
        neg.append(i)
if not len(pos):
    ans = 1
    if k%2:
        for i in range(k):
            ans *= neg[i]
            ans %= mod
    else:
        for i in range(k):
            ans *= neg[-1-i]
            ans %= mod
else:
    ans = 1
    i=len(pos)-1
    j=len(neg)-1
    val = 0
    if n==k:
        for x in arr:
            ans *= x
            ans %= mod
    else:
        if k%2:
            ans *= pos[i]
            i -= 1
            val += 1
        while val != k:
            if i<1:
                ans *= neg[j]*neg[j-1]
                ans %= mod
                j -= 2
            elif j<1:
                ans *= pos[i]*pos[i-1]
                ans %= mod
                i -= 2
            else:
                if pos[i]*pos[i-1]>neg[j]*neg[j-1]:
                    ans *= pos[i]*pos[i-1]
                    ans %= mod
                    i -= 2
                else:
                    ans *= neg[j]*neg[j-1]
                    ans %= mod
                    j -= 2
            val += 2
print(ans)
n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for i  in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]


print(int(max)-int(min))
    


### FIXED CODE ###

n = int(input())

if (n%2 == 0):
    print(n)
else:
    print(2*n)
a,b = map(int, input().split())
if a*b % :
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a,b = map(int, input().split())
if a*b % 2:
    print("Yes")
else:
    print("No")
k, s = [int(x) for x in input().split()]
cnt = 0
for x in range(k + 1):
    if x > s:
        continue
    for y in range(x, k + 1):
        if y > s:
            break
        for z in range(y, k + 1):
            if z > s:
                break
            if x + y + z == s:
                if x == y == z:
                    cnt += 1
                elif x == y or y == z:
                    cnt += 3
                else:
                    cnt += 3
print(cnt)


### FIXED CODE ###

a, b, c = input().split(',')
print(a, b, c)
##!/usr/bin/env python
## -*- coding: utf-8 -*-
#import sys
#import os
#f = open('input.txt', 'r')
#sys.stdin = f
#input = sys.stdin.readline
# A　range flip find route

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

dp = [[0 for i in range(w)] for j in range(h)]

maze = []
for i in range(h):
    sub = list(input())[:-1]
    maze.append(sub)

if maze[0][0] == "#":
    dp[0][0] = 1
for i in range(1, w):
    if maze[0][i - 1] == "." and maze[0][i] == "#":
        dp[0][i] = dp[0][i - 1] + 1

    else:
        dp[0][i] = dp[0][i - 1]
for j in range(1, h):
    if maze[j - 1][0] == "." and maze[j][0] == "#":
        dp[j][0] = dp[j - 1][0] + 1
    else:
        dp[j][0] = dp[j - 1][0]

for i in range(1, h):
    for j in range(1, w):
        d = dp[i - 1][j]
        e = dp[i][j - 1]
        if maze[i - 1][j] == "." and maze[i][j] == "#":
            d += 1
        if maze[i][j - 1] == "." and maze[i][j] == "#":
            e += 1
        dp[i][j] = min(d, e)
print(dp[h - 1][w - 1])


### FIXED CODE ###

##!/usr/bin/env python
## -*- coding: utf-8 -*-
#import sys
#import os
#f = open('input.txt', 'r')
#sys.stdin = f
#input = sys.stdin.readline
# A　range flip find route

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

dp = [[0 for i in range(w)] for j in range(h)]

maze = []
for i in range(h):
    sub = list(input())
    maze.append(sub)

if maze[0][0] == "#":
    dp[0][0] = 1
for i in range(1, w):
    if maze[0][i - 1] == "." and maze[0][i] == "#":
        dp[0][i] = dp[0][i - 1] + 1

    else:
        dp[0][i] = dp[0][i - 1]
for j in range(1, h):
    if maze[j - 1][0] == "." and maze[j][0] == "#":
        dp[j][0] = dp[j - 1][0] + 1
    else:
        dp[j][0] = dp[j - 1][0]

for i in range(1, h):
    for j in range(1, w):
        d = dp[i - 1][j]
        e = dp[i][j - 1]
        if maze[i - 1][j] == "." and maze[i][j] == "#":
            d += 1
        if maze[i][j - 1] == "." and maze[i][j] == "#":
            e += 1
        dp[i][j] = min(d, e)
print(dp[h - 1][w - 1])