Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(100000)
N = int(input())
S = str(N)
def f(s, p, x):
    if len(s) == 0:
        return 1 if x == 7 else 0
    if p:
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '8' or s[0] == '9':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '7':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], False, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '6':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '5':
        return f(s[1:], True, x | 1) + f(s[1:], False, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '4':
        return f(s[1:], True, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '3':
        return f(s[1:], False, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '2' or s[1] == '1':
        return (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '0':
        return 0
ans = f(S, False, 0)
print(ans)


### FIXED CODE ###

N = int(input())
S = str(N)
def f(s, p, x):
    if len(s) == 0:
        return 1 if x == 7 else 0
    if p:
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '8' or s[0] == '9':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], True, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '7':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + f(s[1:], False, x | 4) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '6':
        return f(s[1:], True, x | 1) + f(s[1:], True, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '5':
        return f(s[1:], True, x | 1) + f(s[1:], False, x | 2) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '4':
        return f(s[1:], True, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '3':
        return f(s[1:], False, x | 1) + (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '2' or s[0] == '1':
        return (f(s[1:], True, x) if x == 0 else 0)
    if s[0] == '0':
        return 0
ans = f(S, False, 0)
print(ans)
X,K,D=map(int,input().split())
a=round(abs(X/D))
if K<a:
  print(abs(abs(X)-K*abs(D)))
elif (K-a)%2==0:
  l=[]
  l.append(abs(abs(X)-a*abs(D)))
  l.append(abs(abs(X)-(a+2)*abs(D)))
  l.append(abs(abs(X)-(a-2)*abs(D)))
  print(min(l))
elif (K-a)%2!=0:
  l=[]
    l.append(abs(abs(X)-(a+1)*abs(D)))
    l.append(abs(abs(X)-(a-1)*abs(D)))  
  print(min(l))

### FIXED CODE ###

X,K,D=map(int,input().split())
a=round(abs(X/D))
if K<a:
  print(abs(abs(X)-K*abs(D)))
elif (K-a)%2==0:
  l=[]
  l.append(abs(abs(X)-a*abs(D)))
  l.append(abs(abs(X)-(a+2)*abs(D)))
  l.append(abs(abs(X)-(a-2)*abs(D)))
  print(min(l))
elif (K-a)%2!=0:
  l=[]
  l.append(abs(abs(X)-(a+1)*abs(D)))
  l.append(abs(abs(X)-(a-1)*abs(D)))  
  print(min(l))
import numpy as np
N = int(input())
H = np.array(list(map(int,input().split())))

ans = 0
while np.max(H) != 0:
    min_h_p = 0
    for i in range(N):
        if H[i] == 0 and min_h_p > 0:
            ans += min_h_p
            H[st:i] -= min_h_p
            break
        elif i == N-1:
            if min_h_p == 0:
                min_h_p = H[i]
            ans += min_h_p
            H[st:] -= min_h_p
            break
        else:
            if min_h_p == 0:
                min_h_p = H[i]
                st = i
            else:
                min_h_p = min(H[i],min_h_p)

print(ans)


### FIXED CODE ###

import numpy as np
N = int(input())
H = np.array(list(map(int,input().split())))

ans = 0
while np.max(H) != 0:

    min_h_p = 0
    st = -1
    for i in range(N):
        if st == -1:
            if H[i] > 0:
                st = i
            if i == N-1:
                ans += H[i]
                H[i] = 0
                break
        elif H[i] == 0:
            min_h_p = min(H[st:i])
            ans += min_h_p
            H[st:i] -= min_h_p
            break
        elif i == N-1:
            min_h_p = min(H[st:])
            ans += min_h_p
            H[st:] -= min_h_p
            break
print(ans)
import fractions
def two_avvreviation(n, m, s, t):
    common = fractions.gcd(n, m)
    s_common = [a for i, a in enumerate(zip(s)) if i % int(n / common + 10 ** -6) == 0]
    t_common = [a for i, a in enumerate(zip(t)) if i % int(m / common + 10 ** -6) == 0]
    ret = int(n * m / common + 10 ** -6) if s_common == t_common else -1
    return ret


N, M = [int(a) for a in input().split()]
S = int(input())
T = int(input())

print(str(two_avvreviation(N, M, S, T)))


### FIXED CODE ###

import fractions


def two_abbreviation(n, m, s, t):
    common = int(fractions.gcd(n, m) + 10 ** -6)
    s_common = [a for i, a in enumerate(zip(s)) if i % int(n / common + 10 ** -6) == 0]
    t_common = [a for i, a in enumerate(zip(t)) if i % int(m / common + 10 ** -6) == 0]
    ret = int(n * m / common + 10 ** -6) if s_common == t_common else -1
    return ret


N, M = [int(a) for a in input().split()]
S = str(input())
T = str(input())

print(str(two_abbreviation(N, M, S, T)))
# -*- coding: utf-8 -*-
 
N = int(input())
C = input()

ans = 0
i = -1
j = N
while( True ):
  
  while( i<j ):
    i += 1
    if( C[i] == 'W' ):
      break
  
  while( j>i ):
    j -= 1
    if( C[j] == 'R' ):
      break
  
  if ( i<j ):
    ans += 1
  else:
    break

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
N = int(input())
C = input()

ans = 0
i = -1
j = N
while( True ):
  
  i += 1
  while( i<j ):
    if( C[i] == 'W' ):
      break
    else:
      i += 1
  
  j -= 1
  while( j>i ):
    if( C[j] == 'R' ):
      break
    else:
      j -= 1
  
  if ( i<j ):
    ans += 1
  else:
    break

print(ans)
N = int(input())
h = list(map(int, input().split()))

cnt = 0
cnt_line = 0
v = h[0]
for i in range(1, N):
    if h[i] < v:
        cnt += v - cnt_line
        cnt_line = h[i]
    v = h[i]
    
if h[-1] >= h[-2]:
    cnt += h[-1] - cnt_line

print(cnt)

### FIXED CODE ###

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


if len(h) == 1:
    print(h[0])
    exit()
    
cnt = 0
cnt_line = 0
v = h[0]
for i in range(1, N):
    if h[i] < v:
        cnt += v - cnt_line
        cnt_line = h[i]
    v = h[i]
if h[-1] >= h[-2]:
    cnt += h[-1] - cnt_line
print(cnt)
X=int(input(),16)
Y=int(input(),16)
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")

### FIXED CODE ###

X,Y=input().split()
if X>Y:
    print(">")
elif X<Y:
    print("<")
else:
    print("=")
import math
a,b = map(int,input().split())
print(int(a*b/math.gcd(a,b)))

### FIXED CODE ###

import fractions
a,b = map(int,input().split())
print(int(a*b/fractions.gcd(a,b)))
a,b,c=map(int,input().split())
A=list(a,b,c)
print(sum(A)-max(A))

### FIXED CODE ###

a,b,c=map(int,input().split())
A=[a,b,c]
print(sum(A)-max(A))
A, B = map(int, input().split())
L=list(map(int,input().split()))
L = [abs(i - A) for i in L]
L +=[0]
L=sorted(L)
x=0
i,j=0,1
while True:
    if L[i] == x and L[j] == x :
        i,j = i+2,j+2
        x += 1
    else:
        break
print(A+x)

### FIXED CODE ###

L=list(map(int,input().split()))
for i in range(5):
    if L[i] == 0 and i == 0:
        print(L[i+1] - 1)
    elif L[i] == 0 and i != 0:
        print(L[i-1] +1)
cnt=0
k,s=map(int,input().split())
for i in range(k+1):
    for j in range(k+1):
        if (0<=s-x-y<=k):
                cnt+=1
print(cnt)


### FIXED CODE ###

cnt=0
k,s=map(int,input().split())
for i in range(k+1):
    for j in range(k+1):
        if (0<=s-i-j<=k):
                cnt+=1
print(cnt)
mod = 10 ** 9 + 7

n,m = map(int,input().split())
if not m == 0:
    lis = [int(input()) for x in range(m)]
stairs = [0 for x in range(n)]
stairs[0] = 1
if 1 in lis:
    stairs[1] = 0
else:
    stairs[1] = 1
#print(stairs)
f = 0
for x in range(2,n):
    if x in lis:
        stairs[x] = 0
    else:
        stairs[x] = (stairs[x-1] + stairs[x-2]) % mod
    
#print(stairs)
print((stairs[n-1] + stairs[n-2]) % mod)
    


### FIXED CODE ###

import sys
mod = 10 ** 9 + 7

n,m = map(int,input().split())
if n in [0,1]:
    print(1)
    sys.exit()
    
if not m == 0: lis = [int(input()) for x in range(m)]
else: lis = [-1]
val1 = 1
if 1 in lis: val2 = 0
else: val2 = 1

if lis[0] == 1 and len(lis) >= 2:
    flg = lis[1]
    nex = 1
else:
    flg = lis[0]
    nex = 0
#print(lis)
for x in range(2,n):
    if x == flg: #x in lis
        #print(flg)
        nex += 1
        try: flg = lis[nex]
        except:flg = 0
        now = 0
    else:
        now = (val1 + val2) % mod
    val1,val2 = val2,now
    
print((val1 + val2) % mod)
tracks = []
while 1:
    try:
        c = int(raw_input())
        if c == 0:
            print tracks.pop()
        else:
            tracks.append(c)
    except EOFError:
        break

### FIXED CODE ###

tracks = []
while 1:
    try:
        c0 = raw_input()
        if c0 == '':
            break
        c = int(c0)
        if c == 0:
            print tracks.pop()
        else:
            tracks.append(c)
    except EOFError:
        break
input = raw_input().split()
print input[0] * input[1], 2 * (input[0] + input[1])

### FIXED CODE ###

length = raw_input().split(" ")
length[0] = int(length[0])
length[1] = int(length[1])
print length[0] * length[1], 2 * (length[0] + length[1])
import sys
N = int(input())
a_lis = [int(_) for _ in input().split()]

if set(b) == {0}:
    print('Yes')
    sys.exit()
else:
    if len(a_lis) % 3 == 0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

from collections import Counter
import sys
from functools import reduce
N = int(input())
A = [int(_) for _ in input().split()]

if set(A) == {0}:
    print('Yes')
    sys.exit()

counter = Counter(A)

if len(counter) and len(set(counter.values())) == 1:
    if reduce(lambda x, y: x ^ y, counter.keys()) == 0:
        print('Yes')
        sys.exit()

if len(counter) == 2:  
    if 0 in counter.keys():
        if counter[0] == len(A) // 3:
            print('Yes')
            sys.exit()
print('No')
import fraction
def lcm(x,y):
    return x*y/math.gcd(x,y)

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

print(int(lcm(a,b)))

### FIXED CODE ###

import fractions
def lcm(x,y):
    return x*y/fractions.gcd(x,y)

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

print(int(lcm(a,b)))
st = [ "Sunny" , "Cloudy" , "Rainy" ]
x = input()
print(st[st.index(x) + 1 % 3])

### FIXED CODE ###

st = [ "Sunny" , "Cloudy" , "Rainy" ]
x = input()
s = st.index(x) + 1
if s <= 2 :
    print(st[s])
else :
    print(st[0])
a=input()
b=input()

if (int(a)*int(b))%2==0:
    print("Couple num")
else:
    print("Odd num")


### FIXED CODE ###

a,b = input().split()

if (int(a)*int(b))%2==0:
    print("Even")
else:
    print("Odd")
if a >= 3200:
  print(s)
else:
  prinf('red')

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
  print(s)
else:
  print('red')
N= int(input())
S = input()
T = input()
ans = ""
for i in range(N):
  ans = ans+S[i]+T[i]
print(ans)

### FIXED CODE ###

N= int(input())
S,T = input().split(" ")

ans = ""
for i in range(N):
  ans = ans+S[i]+T[i]
print(ans)
W, H = map(int, input().split())
m = [list(map(int, input().split())) for i in range(H)]
dx = [[1, 1, 1, 0, -1, 0], [0, 1, 0, -1, -1, -1]]
dy = [-1, 0, 1, 1, 0, -1]
def dfs(x, y):
    if m[y][x] != 0:
        return
    m[y][x] = 2
    for xx, yy in zip(dx[y % 2], dy):
        tx, ty = x + xx, y + yy
        if 0 <= tx < W and 0 <= ty < H:
            dfs(tx, ty)

for x in range(W):
    dfs(x, 0)
    dfs(x, H - 1)
for y in range(H):
    dfs(0, y)
    dfs(W - 1, y)

from itertools import product
n = 0
for x, y in product(range(W), range(H)):
    if m[y][x] != 1:
        continue
    fn = n
    for xx, yy in zip(dx[y % 2], dy):
        tx, ty = x + xx, y + yy
        if 0 <= tx < W and 0 <= ty < H:
            if m[ty][tx] == 2:
                n += 1
        else:
            n += 1
print(n)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
W, H = map(int, input().split())
m = [list(map(int, input().split())) for i in range(H)]
dx = [[1, 1, 1, 0, -1, 0], [0, 1, 0, -1, -1, -1]]
dy = [-1, 0, 1, 1, 0, -1]
def dfs(x, y):
    if m[y][x] != 0:
        return
    m[y][x] = 2
    for xx, yy in zip(dx[y % 2], dy):
        tx, ty = x + xx, y + yy
        if 0 <= tx < W and 0 <= ty < H:
            dfs(tx, ty)

for x in range(W):
    dfs(x, 0)
    dfs(x, H - 1)
for y in range(H):
    dfs(0, y)
    dfs(W - 1, y)

from itertools import product
n = 0
for x, y in product(range(W), range(H)):
    if m[y][x] != 1:
        continue
    fn = n
    for xx, yy in zip(dx[y % 2], dy):
        tx, ty = x + xx, y + yy
        if 0 <= tx < W and 0 <= ty < H:
            if m[ty][tx] == 2:
                n += 1
        else:
            n += 1
print(n)
N=list(str(input()))
ans=0
for i in range(1,N):
    if N[i]!='9':
        ans+=int(N[0])-1
        ans+=(len(N)-1)*9
        print(ans)
        exit()
for i in range(N):
    ans+=int(N[i])
print(ans)
        

### FIXED CODE ###

N=list(str(input()))
ans=0
if len(N)==1:
    print(int(N[0]))
    exit()
for i in range(1,len(N)):
    if N[i]!='9':
        ans+=int(N[0])-1
        ans+=(len(N)-1)*9
        print(ans)
        exit()
for i in range(len(N)):
    ans+=int(N[i])
print(ans)
import math
def lcm(x, y):
    return (x*y) // math.gcd(x,y)
A, B, C, D = map(int,input().split())
L = lcm(C,D)
#A-1以下のCorDで割り切れる個数
a = (A-1)//C + (A-1)//D - (A-1)//lcm(C,D)
#B以下のCorDで割り切れる個数
b = B//C + B//D - B//lcm(C,D)
ans = B-(A-1) - (b-a)
print(ans)

### FIXED CODE ###

import fractions
def lcm(x, y):
    return (x*y) // fractions.gcd(x,y)
A, B, C, D = map(int,input().split())
L = lcm(C,D)
#A-1以下のCorDで割り切れる個数
a = (A-1)//C + (A-1)//D - (A-1)//lcm(C,D)
#B以下のCorDで割り切れる個数
b = B//C + B//D - B//lcm(C,D)
ans = B-(A-1) - (b-a)
print(ans)
import math

N, K = map(int, input().split())
ans = 0
for m in range(1, N+1):
    x = math.log2(K / m)
    if x - int(x) > 0:
        x += 1
    if x > 1:
        ans += (1/2) ** int(x) / N
    else:
        ans += 1 / N
print(ans)

### FIXED CODE ###

import math

N, K = map(int, input().split())
ans = 0
for m in range(1, N+1):
    x = math.log2(K / m)
    if x - int(x) > 0:
        x += 1
    if x > 1:
        ans += (1/2) ** int(x) / N
    else:
        ans += 1 / N
print(ans)
a = str(input())
b = str(input())
c = 0
for i in range(len(a)):
  if a[i] == b[i]:
    c += 0
  else:
    b[i] = a[i]
    c += 1
print(c)

### FIXED CODE ###

a = str(input())
b = str(input())
c = 0
for i in range(len(a)):
  if a[i] == b[i]:
    c += 0
  else:
    c += 1
print(c)
import sys
readline=sys.stdin.readline

A,B=map(int,readline().split())
print(int(A * B))


### FIXED CODE ###

from fractions import Fraction

A,B = input().split()
#A = int(A)
#B = float(B)

from decimal import *

a = Decimal(A)
b = Decimal(B)
getcontext().prec = 28
ans = a * b
print(int(ans))
s = input()
D = float(s[0])
T = float(s[1])
S = float(s[2])
if (D > T * S):
	print("No")
else:
	print("Yes")

### FIXED CODE ###

type_in = input()
s = type_in.split(' ')
D = int(s[0])
T = int(s[1])
S = int(s[2])
if (D <= T * S):
	print("Yes")
else:
	print("No")
c11,c12,c13 = map(int,input().split())
c21,c22,c23 = map(int,input().split())
c31,c32,c33 = map(int,input().split())
print(c11 + c22 + c33)

### FIXED CODE ###

c1 = input()
c2 = input()
c3 = input()
print(c1[0] + c2[1] + c3[2])
nums = [int(i) for i in input().split()]

if a < b and b < c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

nums = [int(i) for i in input().split()]

if nums[0] < nums[1] and nums[1] < nums[2]:
    print("Yes")
else:
    print("No")
x,n = map(int, input().split())
l = list(map(int, input().split()))
l_dis = [num - x for num in l]

def s_func(x):
    if x < 0:
        return abs(x) - 0.5
    else:
        return abs(x)
    
l_dis = sorted(l_dis, key=s_func)
if not l_dis:
    print(x)
elif l_dis[0] != 0:
    print(x)
else:
    i = 1
    j = 1
    b = -1
    while True:
        if l_dis[i] != j*b:
            print(x + j*b)
            break
        i += 1
        b *= -1
        if l_dis[i] != j*b:
            print(x + j*b)
            break
        i += 1
        b *= -1
        j += 1

### FIXED CODE ###

x,n = map(int, input().split())
l = list(map(int, input().split()))
l_dis = [num - x for num in l]

def s_func(x):
    if x < 0:
        return abs(x) - 0.5
    else:
        return abs(x)
    
l_dis = sorted(l_dis, key=s_func)
if len(l_dis)==0:
    print(x)
elif l_dis[0] != 0:
    print(x)
else:
    i = 1
    j = 1
    b = -1
    while True:
        if i > len(l_dis)-1 or l_dis[i] != j*b:
            print(x + j*b)
            break
        i += 1
        b *= -1
        if i > len(l_dis)-1 or l_dis[i] != j*b:
            print(x + j*b)
            break
        i += 1
        b *= -1
        j += 1
n = int(input())
l = []
for i in range(n):
  a = n[i]
  sum_a += a
if n % sum_a == 0:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

N = input()
ans = 0
for i in N:
    ans += int(i)
if int(N)%ans == 0:
    print('Yes')
else:
    print('No')
n=int(raw_input())
t=map(int,raw_input().split())
total=sum(t)
m=int(raw_input())
for _ in xrange(m):
	p,x=map(int,raw_input())
	print total-t[p-1]+x

### FIXED CODE ###

n=int(raw_input())
t=map(int,raw_input().split())
total=sum(t)
m=int(raw_input())
for _ in xrange(m):
	p,x=map(int,raw_input().split())
	print total-t[p-1]+x
import math
n = int(input())
a = list(map(int,input().split()))
lcm = 1
for v in a:
	lcm *= v//math.gcd(v,lcm)
ans = 0
for v in a:
	ans += lcm // v
print(ans%1000000007)

### FIXED CODE ###

def gcd(a,b):
	return gcd(b,a%b) if b else a
n = int(input())
a = list(map(int,input().split()))
lcm = 1
for v in a:
	lcm *= v//gcd(v,lcm)
ans = 0
for v in a:
	ans += lcm // v
print(ans%1000000007)
n=int(input())

a=list(map(int,input().split()))
  
b=[]
for j in range (n-1):
  c=a[j+1]-a[j]
  b.append(c)
  
print(max(b))


### FIXED CODE ###

n=int(input())

a=list(map(int,input().split()))
  
b=[]
if n>1:
  for j in range (n-1):
    c=a[j]-a[j+1]
    if c>-1:
      b.append(c)
      a[j+1]=a[j+1]+c
    else:
      b.append(0)
      
   
  if max(b)>-1:
    print(sum(b))
  else:
    print(0)
    
else:
  print(0)
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
x=input()
p=0
for i in x:
    if i=="1":
        p+=1
rp=0
rq=0
for i in range(n):
    if x[i]=="1":
        rp+=pow(2,(n-1-i),p+1)
        rq+=pow(2,(n-1-i),p-1)
        rp%=p+1
        rq%=p-1

def popcnt1(n):
    return bin(n).count("1")
res=[0]*n

for i in range(1,n+1):
    res[i-1]=i%popcnt1(i)

for i in range(n):
    ans=0
    if x[i]=="1":
        q=rq-pow(2,(n-1-i),p-1)
        q%=p-1
        while True:
            if q==0:
                print(1+ans)
                break
            ans+=1
            q=res[q-1]
    else:
        q=rp+pow(2,(n-1-i),p+1)
        q%=p+1
        while True:
            if q==0:
                print(1+ans)
                break
            ans+=1
            q=res[q-1]

### FIXED CODE ###

#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
x=input()
p=0
for i in x:
    if i=="1":
        p+=1
rp=0
rq=0
for i in range(n):
    if x[i]=="1":
        rp+=pow(2,(n-1-i),p+1)
        rp%=p+1
        if p!=1:
          rq+=pow(2,(n-1-i),p-1)
          rq%=p-1
        else:
          rq=pow(2,(n-1-i))
def popcnt1(n):
    return bin(n).count("1")
res=[0]*n

for i in range(1,n+1):
    res[i-1]=i%popcnt1(i)

for i in range(n):
    ans=0
    if x[i]=="1":
        if p==1:
          print(0)
          continue
        q=rq-pow(2,(n-1-i),p-1)
        q%=p-1
        while True:
            if q==0:
                print(1+ans)
                break
            ans+=1
            q=res[q-1]
    else:
        q=rp+pow(2,(n-1-i),p+1)
        q%=p+1
        while True:
            if q==0:
                print(1+ans)
                break
            ans+=1
            q=res[q-1]
def calc():
    d = a
    a = b
    b = d

    d = a
    a = c
    c = d

    list = [a,b,c]
    return list

a, b, c = map(int, input().split())
print(calc())

### FIXED CODE ###

def calc():
    x, y, z = c, a, b

    print(x, y, z)

a, b, c = map(int, input().split())
calc()
O = input()
E = input()
P = ''
for i in range(len(O)+len(E)) :
    P = P + O[i]
    P = P + E[i]
print(P)
    

### FIXED CODE ###

O = str(input())
E = str(input())
P = ''
for i in range(len(E)) :
    P = P + O[i]
    P = P + E[i]
if len(O) == len(E) :
    print(P)
else :
    print(P + O[-1])
import math
x = int(input())
b = 0

@njit
def calc(b, b5):
    a = (x+b5)**0.2

    if a.real.is_integer():
        print(int(a), b)
        exit()

while True:
    b5 = b ** 5
    calc(b, b5)
    calc(-b, -b5)
    b += 1


### FIXED CODE ###

import math
x = int(input())
b = 0

"""
def calc(b, b5):
    a = (x+b5)**0.2

    if a.real.is_integer():
        print(int(a), b)
        exit()

while True:
    b5 = b ** 5
    calc(b, b5)
    if x-b5 >= 0:
        calc(-b, -b5)
    b += 1
    """

for i in range(-120,120):
    for j in range(-120,120):
        if i**5 - j**5 == x:
            print(i, j)
            exit()
n = input()
k = input()
if (2 < n / k):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

in_ = input()
n, k = map(int, in_.split())

if (k == 1):
    print("YES")
    exit()

if ((n % 2) == 1):
    n += 1

if (2 <= (n / k)):
    print("YES")
else:
    print("NO")
#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-pont[j][k])**2
		if isinstance(a**0.5, int) 
		m += 1
print(m)

### FIXED CODE ###

#入力
n, d = map(int, input().split())
point = [[int(i) for i in input().split()] for j in range(n)]
#点1から計算する
m = 0
for i in range(n):
	for j in range(i+1,n):
		a = 0
		for k in range(d):
			a += (point[i][k]-point[j][k])**2
		b = a**(1/2)
		if b.is_integer():
			m += 1
print(m)
from bisect import bisect_right

n, d, a = map(int, input().split())
xh = sorted(list(map(int, input().split())) for _ in range(n))
x = [0] * (n + 1)
h = [0] * (n + 1)
s = [0] * (n + 1)

for i, (f, g) in enumerate(xh):
    x[i], h[i] = f, g
x[n] = 10 ** 9 + 1
ans = 0
for i in range(n):
    if i > 0:
        s[i] += s[i - 1]
    h[i] -= s[i]
    if h[i] > 0:
        num = 0 - - h[i] // a
        ans += num
        s[i] += num * a

        j = bisect_right(x, x[i] + d * 2)
        s[j] -= num * a
print(ans)


### FIXED CODE ###

from bisect import bisect_right

n, d, a = map(int, input().split())
xh = sorted(list(map(int, input().split())) for _ in range(n))
x = [0] * (n + 1)
h = [0] * (n + 1)
s = [0] * (n + 1)

for i, (f, g) in enumerate(xh):
    x[i], h[i] = f, g
x[n] = 10 ** 10 + 1
ans = 0
for i in range(n):
    if i > 0:
        s[i] += s[i - 1]
    h[i] -= s[i]
    if h[i] > 0:
        num = 0 - - h[i] // a
        ans += num
        s[i] += num * a

        j = bisect_right(x, x[i] + d * 2)
        s[j] -= num * a
print(ans)
a=int(input())
b=int(input())
print((a-1)*(b-1))

### FIXED CODE ###


a,b=map(int,input().split())
print((a-1)*(b-1))