Harryxun/stf_run huggingface dataset:
def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    mod = 10**9+7

    fact = [1]

    for i in range(1, n+1):
        fact.append(fact[-1]*i % mod)

    def inv_n(n, mod=10**9+7): return pow(n, mod-2, mod)
    def nCr(n, r, mod=10**9+7): return inv_n(fact[n-r]
                                             * fact[r] % mod, mod)*fact[n] % mod

    ans = 0

    for i in range(n-k+1):
        ans = (ans+nCr(n-i-1, k-1)*(a[n-i-1]-a[i])) % mod
    print(ans)


main()


### FIXED CODE ###

def main():
    h, w = map(int, input().split())
    grid = [input() for _ in [0]*h]
    ans_list = []
    for i in range(h):
        for j in range(w):
            if grid[i][j] == ".":
                ans_list.append((i, j))
    m = 0
    for i, j in ans_list:
        q = [(i, j)]
        dist = [[-1]*w for _ in [0]*h]
        cnt = 0
        dist[i][j] = 0
        while q:
            qq = []
            cnt += 1
            while q:
                x, y = q.pop()
                if x > 0:
                    if dist[x-1][y] == -1:
                        if grid[x-1][y] == ".":
                            dist[x-1][y] = cnt
                            qq.append((x-1, y))
                if x < h-1:
                    if dist[x+1][y] == -1:
                        if grid[x+1][y] == ".":
                            dist[x+1][y] = cnt
                            qq.append((x+1, y))
                if y > 0:
                    if dist[x][y-1] == -1:
                        if grid[x][y-1] == ".":
                            dist[x][y-1] = cnt
                            qq.append((x, y-1))
                if y < w-1:
                    if dist[x][y+1] == -1:
                        if grid[x][y+1] == ".":
                            dist[x][y+1] = cnt
                            qq.append((x, y+1))
            q = qq
        m = max(m, max([max([l for l in k]) for k in dist]))
    print(m)


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

def ans(cnt,a,b,c=0):
    if cnt == a :
        return c
    else :
        if cnt == 0: 
            c += b
            cnt += 1
            return ans(cnt,a,b,c) 
        else: 
            cnt += 1
            c = c*(b-1)
            return ans(cnt,a,b,c)

a = ans(cnt = 0,a = n,b = k,c=0)
print(a)



### FIXED CODE ###

n,k = map(int,input().split())
ans = k*(k-1)**(n-1)
print(ans)
N,K = map(int,input().split())
if K%2==1:
    d1=n//(k//2)
    d2=n//k
    ans=d2**3+(d1-d2)**3
else:
    d=n//k
    ans = d**3
print(ans)
    

### FIXED CODE ###

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

if K%2==0:
    d1=N//(K//2)
    d2=N//K
    ans=d2**3+(d1-d2)**3
else:
    d=N//K
    ans = d**3

print(ans)
import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])
    atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])

    atmp = -1
    if len(a) != 0:
        atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

if __name__ == '__main__':
    main()
s = input()
n = int(input())

i = 0
while s[i] == '1':
    i += 1

if n <= i:
    print(1)
else:
    print(s[i])

### FIXED CODE ###


s = input()
n = int(input())

i = 0
while i != len(s) and s[i] == '1':
    i += 1

if n <= i:
    print(1)
else:
    print(s[i])
from math import factorial

def cmb(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

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

for i in range(1, K + 1):
  print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10 ** 9 + 7))

### FIXED CODE ###

from math import factorial

def cmb(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))

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

for i in range(1, K + 1):
  try:
    print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10 ** 9 + 7))
  except:
    print(0)
print(-(-(a+b)//2))

### FIXED CODE ###

a,b=map(int,input().split());print(-(-(a+b)//2))
h,w = map(int,input().split())
board = []
checkX = [False]*w
checkY = [False]*h
for i in range(h):
    board.append(input())

for i in range(w):
        for j in range(h):
            if board[i][j] == "#":
                checkX[i] = True
                checkY[j] = True
for i in range(w):
    if checkX[i]:
        for j in range(h):
            if checkY[j]:
                print(board[i][j],end="")
        print("")

### FIXED CODE ###

h,w = map(int,input().split())
board = []
checkColumn = [False]*h
checkRow = [False]*w
for i in range(h):
    board.append(input())

for i in range(h):
        for j in range(w):
            if board[i][j] == "#":
                checkColumn[i] = True
                checkRow[j] = True
for i in range(h):
    if checkColumn[i]:
        for j in range(w):
            if checkRow[j]:
                print(board[i][j],end="")
        print()
N, M = map(int, input().split(" "))
height = map(int, input().split(" "))
flag = [1 for i in renge(len(height))]
for i in range(M):
  a, b = map(int, input().split(" "))
  if height[a - 1] > height[b - 1]:
    flag[b - 1] = 0
  elif height[b - 1] > height[a - 1]:
    flag[a - 1] = 0
print(sum(flag))

### FIXED CODE ###

N, M = map(int, input().split(" "))
height = list(map(int, input().split(" ")))
flag = [1 for i in height]
for i in range(M):
  a, b = map(int, input().split(" "))
  if height[a - 1] > height[b - 1]:
    flag[b - 1] = 0
  elif height[b - 1] > height[a - 1]:
    flag[a - 1] = 0
  else:
    flag[a - 1] = 0
    flag[b - 1] = 0
print(sum(flag))
def resolve():

    N,M = map(int,input().split())
    ab =[map(int,input().split()) for _ in range(N)]
    branch = [[] for _ in range(N)]
    for a,b in ab:
        branch[a-1].append(b-1)
        branch[b-1].append(a-1)
    
    bit = 0
    count = 0
    def walk(p):
        nonlocal bit,N
        bit |= (1 << p)
        if bit == 2 ** N - 1:
            nonlocal count
            count += 1
        for n in branch[p]:
            if not(bit & (1 << n)):
                walk(n)
        bit &= ~(1 << p)

    walk(0)
    print(count)
resolve()

### FIXED CODE ###

def resolve():
    import sys
    sys.setrecursionlimit(10**6)
    
    N,M = map(int,input().split())
    ab =[map(int,input().split()) for _ in range(M)]
    branch = [[] for _ in range(N)]
    for a,b in ab:
        branch[a-1].append(b-1)
        branch[b-1].append(a-1)
    
    bit = 0
    count = 0
    def walk(p):
        nonlocal bit,N
        bit |= (1 << p)
        if bit == 2 ** N - 1:
            nonlocal count
            count += 1
        for n in branch[p]:
            if not(bit & (1 << n)):
                walk(n)
        bit &= ~(1 << p)

    walk(0)
    print(count)
resolve()
N, K = map(int, input().split())
A = list(map(int, input().split()))

L = [0] * (N+1)
now = 1
p = []

for i in range(K):
    if L[now] == 1:
        break
    p.append(now)
    L[now] = 1
    now = A[now-1]

for i in range(len(p)):
    if p[i] == now:
        ans = p[i + (K - i) % len(p[i:])]

print(ans)

### FIXED CODE ###

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

L = [0] * (N+1)
now = 1
p = []
f = False

for i in range(K):
    if L[now] == 1:
        f = True
        break
    p.append(now)
    L[now] = 1
    now = A[now-1]

if f:
    for i in range(len(p)):
        if p[i] == now:
            ans = p[i + (K - i) % len(p[i:])]
            break
else:
    ans = now

print(ans)
n = int(input())
A = [int(i) for i in input().split()]
input()
M = [int(i) for i in input().split()]

def solve(i, m):
    if m == 0:
        return True
    if i >= n or m < 0:
        return False
    res = solve(i+1, m) or solve(i+1, m-A[i])
    return res

for m in M:
    if solve(0, m):
        print('yes')
    else:
        print('no')


### FIXED CODE ###

n = int(input())
A = [int(i) for i in input().split()]
input()
M = [int(i) for i in input().split()]

def solve(i, m):
    if m == 0:
        return True
    if i >= n or m < 0:
        return False
    res = solve(i+1, m) or solve(i+1, m-A[i])
    return res

for m in M:
    if sum(A) < m:
        print("no")
    elif solve(0, m):
        print('yes')
    else:
        print('no')
from math import pi
r = int(input())
print('{.5f} {.5f}'.format(r*r*pi,r*2*pi))

### FIXED CODE ###

from math import pi
r = float(input())
print('{:.5f} {:.5f}'.format(r*r*pi,r*2*pi))
n = input()
if n >= 30:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

n = int(input())
if n >= 30:
  print('Yes')
else:
  print('No')
N = input()
M = input()
N = int(N)
M = int(M)

if N == M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

if N == M:
  print('Yes')
else:
  print('No')
import itertools
import sys
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

def main():
    A, B= map(int,input().split())
    gcd = math.gcd(A,B)
    root = math.sqrt(gcd)

    ps = []
    ans = 1
    for p in range(2,math.floor(root)+2):
        is_prime = True
        for _p in ps:
            if p % _p == 0:
                is_prime = False
                break
        if is_prime:
            ps.append(p)
            if gcd % p == 0:
                ans += 1


    print(ans)


if __name__ == "__main__":
  main()


### FIXED CODE ###

import fractions
import sys
sys.setrecursionlimit(10**9)


INF=10**20
def prime_factorize(n):
    P = []
    P_set = set()
    while n % 2 == 0:
        P.append(2)
        P_set.add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            P.append(f)
            P_set.add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        P.append(n)
        P_set.add(n)

    P_count = {p:0 for p in P_set}
    for p in P: P_count[p] += 1

    return P_count


def solve(A: int, B: int):
    gcd = fractions.gcd(A,B)
    P = prime_factorize(gcd).keys()
    print(len(list(P))+1)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)



if __name__ == "__main__":
    main()
def resolve():
    s,c= map(int,input().split())

    if s>=c/2:
        print(str(math.floor(c/2)))
    else:
        zanc = c - (s * 2)
        print(str(s + math.floor(zanc/4)))
        
resolve()

### FIXED CODE ###

import sys
from io import StringIO
import unittest
import math

def resolve():
    s,c= map(int,input().split())

    if s>=c/2:
        print(str(math.floor(c/2)))
    else:
        zanc = c - (s * 2)
        print(str(s + math.floor(zanc/4)))
        
resolve()
S = input()
T = input()
print(T + S)


### FIXED CODE ###

s,t = input().split()
ans = t + s
print(ans)
n = int(input())
s1 = input()
s2 = input()
cnt = 1
i = 0
while 1:
    if i == 0:
        if s1[i] == s2[i]:
            cnt *= 3
            s = 0
        else:
            cnt *= 6
            i += 1
            s = 1
    elif s1[i] == s2[i]:
        if s == 0:
            cnt *= 2
        else:
            cnt *= 1
        s = 0
    else:
        if s == 0:
            cnt *= 2
        else:
            cnt *= 3
        s = 1
    i += 1
print(cnt)

### FIXED CODE ###

n = int(input())
s1 = input()
s2 = input()
cnt = 1
i = 0
while i <= n-1:
    if i == 0:
        if s1[i] == s2[i]:
            cnt *= 3
            s = 0
        else:
            cnt *= 6
            i += 1
            s = 1
    elif s1[i] == s2[i]:
        if s == 0:
            cnt *= 2
        else:
            cnt *= 1
        s = 0
    else:
        if s == 0:
            cnt *= 2
        else:
            cnt *= 3
        s = 1
        i += 1
    i += 1
print(cnt % (10**9+7))
File Edit Options Buffers Tools Python Help                                             
n, m = [int(x) for x in input().split()]
sc = [[int(x) for x in input().split()] for i in range(m)]
r = [-1] * n
def solution():
    for s, c in sc:
        if r[s - 1] >= 0 and r[s - 1] != c or (s == 1 and c == 0 and n != 1):
            return '-1'
        r[s - 1] = c
    for i in range(n):
        if r[i] < 0:
            if i == 0:
                r[i] = 1
            else:
                r[i] = 0
    return ''.join(str(r[i]) for i in range(n))

print(solution())

### FIXED CODE ###

n, m = [int(x) for x in input().split()]
sc = [[int(x) for x in input().split()] for i in range(m)]
r = [-1] * n
def solution():
    for s, c in sc:
        if s == 1 and c == 0 and n != 1:
            return '-1'
        if r[s - 1] >= 0 and r[s - 1] != c:
            return '-1'
        r[s - 1] = c
    for i in range(n):
        if r[i] < 0:
            if i == 0 and n != 1:
                r[i] = 1
            else:
                r[i] = 0
    return ''.join(str(r[i]) for i in range(n))

print(solution())
an=N//1000
ans=(an+1)*1000-N
if an==0:
  print(0)
else:
  print(ans)

### FIXED CODE ###

N=int(input())
an=N//1000
ans=(an+1)*1000-N
if N%1000==0:
  print(0)
else:
  print(ans)
def partition(hoge, p, r):
    x = int(hoge[r-1][1])
    i = p-1
    for j in range(p, len(hoge)):
        if int(hoge[j][1]) <= x:
            i += 1
            tmp = hoge[i]
            hoge[i] = hoge[j]
            hoge[j] = tmp
    return i
    
def qSort(hoge, p, r):
    if p < r:
        q = partition(hoge, p, r)
        qSort(hoge, p, q-1)
        qSort(hoge, q+1, r)
    
def isStable(input_array, output_array):
    N = len(input_array)
    for i in range(1, N-1):
        for j in range(i+1, N):
            for a in range(1, N-1):
                for b in range(a+1, N):
                    if input_array[i][1] == output_array[j][1] and input_array[i] == output_array[b] and input_array[j] == output_array[a]:
                        return 'Not stable'
    return 'Stable'
    
if __name__ == '__main__':
    num = int(input())
    hoge = list()
    for _ in range(num):
        c, s = input().split()
        hoge.append(c+s)
    origin = hoge[:]
    qSort(hoge, 0, len(hoge))
    print(isStable(origin, hoge))
    print('\n'.join(['{0[0]} {0[1]}'.format(x) for x in hoge]))


### FIXED CODE ###

def partition(hoge, p, r):
    x = int(hoge[r][1])
    i = p-1
    for j in range(p, r):
        if int(hoge[j][1]) <= x:
            i += 1
            tmp = hoge[i]
            hoge[i] = hoge[j]
            hoge[j] = tmp
    tmp = hoge[i+1]
    hoge[i+1] = hoge[r]
    hoge[r] = tmp
    return i+1
    
def qSort(hoge, p, r):
    if p < r:
        q = partition(hoge, p, r)
        qSort(hoge, p, q-1)
        qSort(hoge, q+1, r)
    
def isStable(input_array, output_array):
    same_nums = list()
    now_num = 0
    for elem in output_array:
        if now_num != int(elem[1]):
            now_num = int(elem[1])
            same_nums = list()
        else:
            for c in same_nums:
                if input_array.index(c) > input_array.index(elem):
                    return 'Not stable'
        same_nums.append(elem)
    return 'Stable'
    
if __name__ == '__main__':
    num = int(input())
    hoge = list()
    for _ in range(num):
        c, s = input().split()
        hoge.append((c,s))
    origin = hoge[:]
    qSort(hoge, 0, len(hoge)-1)
    print(isStable(origin, hoge))
    print('\n'.join(['{0[0]} {0[1]}'.format(x) for x in hoge]))
A, B = map(int,input().split())

def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            divisors.add(n//i)
    return divisors

lst_A = make_divisors(A)
lst_B = make_divisors(B)
cmn_lst = lst_A & lst_B
m = max(cmn_lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = set()
for p, v in enumerate(hurui):
    if v == 1:
        cand.add(p)
print(len(cand & cmn_lst))

### FIXED CODE ###

from math import gcd
A, B = map(int,input().split())
max_cmn_div = gcd(A, B)

# 約数列挙関数
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**(1/2))+1):
        if n % i == 0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return divisor

def check_prime(n):
    for i in range(2, int(n**(1/2))+1):
        if n % i == 0:
            return 0
    return 1

cmn_div = make_divisor(max_cmn_div)
ans = 0
for i in cmn_div:
    if check_prime(i):
        ans += 1
print(ans)
n = int(input())

cnt =0

for i in range(26):
    for j in range(15):
        if i * 4 + j * 7 == n:
            cnt +=1
if cnt >0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

#105 A
import math
N,K= map(int,input().split())
print(abs(math.ceil(N/K)- N//K))
pritn(input().replace(",", " "))


### FIXED CODE ###

s=input()
print(s.replace(",", " "))
k, a, b = map(int, input().split())
if a >= b:
    print(1 + k)
else:
    if k > a + 1:
        print(max(a + (b - a) * ((k - (a - 1)) // 2) + ((k - (a - 1)) % 2)), k + 1)
    else:
        print(k)

### FIXED CODE ###

k, a, b = map(int, input().split())
if b - a <= 2:
    print(1 + k)
else:
    if k > a:
        d = (k - a + 1) // 2
        m = (k - a + 1) % 2
        print(max(a + (b - a) * d + m, k + 1))
    else:
        print(k + 1)
def C(A,B,C,X,Y):
    both_price=min(A+B,C*2)
    A_price=min(A,C*2)
    B_price=min(B,C*2)

    both_num=min(X,Y)
    X_num=X-both_num
    Y_num=Y-both_num
    return both_price*both_num+X_num*A_price+Y_num*B_price

inp = sys.stdin.read().split()
inp=[int(i) for i in inp]
print(C(inp[0], inp[1], inp[2],inp[3],inp[4],inp[5]))

### FIXED CODE ###

def main(func):
    ret=func(input())
    print(ret)


def A(S):
    ret=700
    ret+=S.count("o")*100
    return ret

main(A)
import sys
import functools
import operator

L = []
for l in sys.stdin:
  L.append(l) 
A = list(map(int, L[1].split()))

answer = functools.reduce(operator.mul, A)
if answer <= 1000000000000000000:
  print(answer)
else:
  print(-1)

### FIXED CODE ###

A, B = map(int, input().split())
print(A * B)
x=int(input())
y=int(input())
z=int(input())

i=0
while (x-a-b*i)>=0:
	i+=1
i-=1
print(x-a-b*i)

### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())

i=0
while (x-a-b*i)>=0:
	i+=1
i-=1
print(x-a-b*i)
import math
r = 10000
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        for j in range(2*i+1,r,i+1):
            p[j] = 0

while True:
    n = int(raw_input())
    if not n:
        break
    i, num, sum = 0, 1, 0
    while num < n:
        if p[i] == 1:
            num += 1
            sum += i
        i += 1
    print sum

### FIXED CODE ###

import math

r = 105000
sqrt = int(math.sqrt(r))
p = [1]*r
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)]

s = [0 for i in range(11000)]
s[0] = 2
k = 1
for i in range(2,r):
    if p[i]:
        s[k] = i+1+s[k-1]
        k += 1
        
while True:
    n = int(raw_input())
    if not n:
        break
    print s[n-1]
N = int(input())
A = [int(input()) for i in range(N)]
M = max(A)
c = A.count(M)
a = list(set(A))
a.sort(reverse=True)
 
for i in range(N):
  if A[i] != M:
    print(M)
  else:
    if c >= 2:
      print(M)
    else:
      print(a[1])

### FIXED CODE ###

print(((int(input()))**2)*3)
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	a[0]-=a[0]-x
	ans+=a0[0]-x
		if a[0]+a[1]>x:
			a[1]=0
			ans+=a[1]
	
for i in range(1,n-1):
	if a[i]+a[i+1]>x:
		a[i+1]-=a[i]+a[i+1]-x
		ans+=a[i]+a[i+1]-x
print(ans)

### FIXED CODE ###

import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)
import math

a,b,h,m = map(int,input().split())

hangle = float((h/12)*360)
hangle += float((m/60)*30)
mangle = float((m/60)*360)

if hangle > 180 and mangle > 180:
    angle = abs(hangle-mangle)
elif hangle > 180:
    hangle = 360-hangle
    angle = abs(hangle-mangle)
elif mangle > 180:
    mangle = 360-mangle
    angle = abs(hangle-mangle)
else:
    angle = abs(hangle-mangle)

if hangle > 180:
    hangle = 360-hangle
if mangle > 180:
    mangle = 360-mangle

angle = abs(hangle-mangle)
rad = math.radians(angle)

ans = float(math.sqrt(a*a + b*b - float(2*a*b*math.cos(rad))))

if m != 0 and h != 0:
    print('{:.10f}'.format(ans))
else :
    print(0)

### FIXED CODE ###

n = int(input())

if n >= 100:
    n = n%100
    if n >= 10:
        n = n%10
    if n == 3:
        print("bon")
    elif n == 0 or n == 1 or n == 6 or n == 8:
        print("pon")
    else:
        print("hon")
elif n <= 99 and n >= 10:
    n = n%10
    if n == 3:
        print("bon")
    elif n == 0 or n == 1 or n == 6 or n == 8:
        print("pon")
    else:
        print("hon")
else:
    if n == 3:
        print("bon")
    elif n == 0 or n == 1 or n == 6 or n == 8:
        print("pon")
    else:
        print("hon")
S = input().split()
if S[2]==S[3] and S[4]==[5]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")
i = int(input())
ii = input().split()

a = int(0)
n = int(0)
m = int(0)
k = int(0)
for n in ii:
    a = int(n)
    for m in range(i):
      while (a % 1 == 0):
        a = a/2
        if (a % 1 == 0):
            k += 1

print(k)

### FIXED CODE ###

c = input().split()

a = int(c[0])
b = int(c[1])

if a > 8:
    print(':(')

elif b > 8:
    print(':(')

elif a+b > 16:
    print(":(")

else:
    print("Yay!")
N = int(input())
S = list(input())

r , g, b = S.count("R"), S.count("G"), S.count("B")
ans = r * g * b

for i in range(N-2):
    for d in range(N//2+1):
        j = i + d
        k = j + d
        if k < N:
        	if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            	ans -= 1
print(ans)

### FIXED CODE ###

N = int(input())
S = input()

r , g, b = S.count("R"), S.count("G"), S.count("B")
ans = r * g * b

for i in range(N-2):
    for d in range(N//2+1):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1
print(ans)
def solve():
   x = raw_input()
   y = raw_input()
   lenx = len(x)
   leny = len(y)
   
   z = [0 for k in range(b+1)]
   for i in range(lenx):
      a = x[i]
      b = z + []
      for j in range(leny):
         if a == y[i]:
               z[j+1] = b[j] + 1
         elif z[j+1] < z[j]:
               
   print max(z)

n = input()
for i in xrange(n):
   solve()

### FIXED CODE ###

def solve():
    x = raw_input()
    y = raw_input()
    a, b = len(x), len(y)
    x1 = [0 for k in range(b+1)]
    for i in xrange(a):
        c = x[i]
        x2 = x1+[]
        for j in xrange(b):
            if c == y[j]:
                x1[j+1] = x2[j] + 1
            elif x1[j+1] < x1[j]:
                x1[j+1] = x1[j]
    print max(x1)
  
n = input()
for i in xrange(n):
    solve()
"{}{}".fromat(S, T)

### FIXED CODE ###

S, T = input().split()

result = T + S

print(result)