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

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        self.chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

    def solve(self):
        '''
        insert your code
        '''
        while True:
            n = input()
            if n == 0:
                break
            k = map(int, raw_input().split())
            s = raw_input()
            ans = ''
            for i in range(len(s)):
                ans += self.chars[self.chars.index(s[i]) - k[i % len(k)]]
            print ans
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

### FIXED CODE ###

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

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        self.chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

    def solve(self):
        '''
        insert your code
        '''
        while True:
            n = input()
            if n == 0:
                break
            k = map(int, raw_input().split())
            s = raw_input()
            ans = ''
            for i in range(len(s)):
                ans += self.chars[self.chars.index(s[i]) - k[i % len(k)]]
            print ans
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()
k, n = map(int, input().split())
if n == 0:
    print(0)
else:
    l = list(map(int, input().split()))
    l.sort()
    k1 = [i for i in range(min(l), max(l) + 1) if i not in l]
    d = {}
    for i in range(len(k1)):
        d[k1[i]] =max(k1[i],k)-min(k1[i],k)
    k2 = min(d, key=d.get)
    if len(d)==0 or len(k1)<=1:
        print(0)
    else:
        print(k2)

### FIXED CODE ###

x,n=map(int,input().split())
l=list(map(int,input().split()))
if x not in l:
    print(x)
elif n==0:
    print(x)
else:
    a=101
    p1=0
    for i in range(102):
        if i not in l:
            if abs(x-i)<a:
                a=abs(x-i)
                p1=i

    print(p1)
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )

### FIXED CODE ###

N = int(input())
L = [int(i) for i in input().split()]
print(sum(L) - N)
n,m = map(int,input().split())
isl1 = [0]*m
isl2 = [0]*m
for i in range(m):
    (isl1[i], isl2[i]) = map(int,input().split())
    isl1[i] -= 1
    isl2[i] -= 1
boss = [-1]*n
mem = [1]*n
dpt = [0]*n
ans = [0]*m
s = (n*(n-1))//2
ans[m-1] = s
 
def sea(i, boss):
     m = 0
     while boss[i] >= 0:
          i = boss[i]
          m += 1
     return i,m
 
for j in range(m-1):
     i = m-j-1
     i1,i2 = isl1[i],isl2[i]
     p1,m1 = sea(i1, boss)
     p2,m2 = sea(i2, boss)
     if p1 != p2:
          if dpt[m1] < dpt[m2]:
               (p1,p2) = (p2,p1)
          boss[p2] = p1
          s -= mem[p1]*mem[p2]
          mem[p1] += mem[p2]
          mem[p2] = 0
          dpt[p1] = max(dpt[p1],dpt[p2]+1)
     ans[i-1] = s
         
for i in range(m):
     print(ans[i])

### FIXED CODE ###

a,b,c = map(int,input().split())
print(min(c,b//a))
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,m = I()
s = v()
t = v()
l = lcm(n,m)
x = l//n
y = l//m
g = lcm(x,y)
a = 1

while len(s)>= g and len(t)>= g:
    if s[a-1] != t[a-1]:
        print(-1)
        sys.exit()
    a += g

print(l)


### FIXED CODE ###

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,m = I()
s = v()
t = v()
l = lcm(n,m)
g = math.gcd(n,m)

for i in range(g):
    if s[n//g*i] != t[m//g*i]:
        print(-1)
        sys.exit()

print(l)
# AtCoder Beginner Contest 111
# C - /\/\/\/
# https://atcoder.jp/contests/abc111/tasks/arc103_a
from collections import Counter

N, *A = map(int, open(0).read().split())

ev = A[0::2]
od = A[1::2]

ev_C = Counter(ev)
od_C = Counter(od)

if ev == od and ev_C.most_common()[0][0]==N//2:
    print(N//2)
else:
    ans = N
    ev_common = ev_C.most_common()
    od_common = od_C.most_common()
    ev_most = ev_common[0][1]
    od_most = od_common[0][1]
    if ev_common[0][0] == od_common[0][0]:
        ev_second = ev_common[1][1]
        od_second = od_common[1][1]
        ans = min(ans, N-ev_most-od_second)
        ans = min(ans, N-ev_second-od_most)
    else:
        ans = min(ans, N-ev_most-od_most) 

    print(ans)

### FIXED CODE ###

# AtCoder Beginner Contest 111
# C - /\/\/\/
# https://atcoder.jp/contests/abc111/tasks/arc103_a
from collections import Counter

N, *A = map(int, open(0).read().split())

ev = A[0::2]
od = A[1::2]

ev_C = Counter(ev)
od_C = Counter(od)


if ev == od and ev_C.most_common()[0][1] == N//2:
    print(N//2)
else:
    ans = N
    ev_common = ev_C.most_common()
    od_common = od_C.most_common()
    ev_most = ev_common[0][1]
    od_most = od_common[0][1]
    if ev_common[0][0] == od_common[0][0]:
        ev_second = ev_common[1][1]
        od_second = od_common[1][1]
        ans = min(ans, N-ev_most-od_second)
        ans = min(ans, N-ev_second-od_most)
    else:
        ans = min(ans, N-ev_most-od_most)

    print(ans)
N,K=list(map(int,input().split()))
l=input()
n=l[0]
cnt=0
ans=[]
for i in l:
   if i != n:
      ans.append(cnt)
      cnt=1
      n=i
   else:
      cnt+=1
ans.append(cnt)
if l[0] == "0":
   sum_n=sum(ans[0:K*2])
   now=1
   end=K*2
else:
   sum_n=sum(ans[0:K*2+1])
   now=0
   end=K*2+1
max_n=sum_n
for i in range(len(ans)-end+1):
   sum_n-=ans[i]
   if now==0:
      now=1
   else:
      try:
         sum_n=sum_n+ans[end]+ans[end+1]
         end+=2
      except IndexError:
         sum_n+=ans[end]
         max_n=max(sum_n,max_n)
         print(max_n)
         exit()
      now=0
   max_n=max(sum_n,max_n)
print(max_n)

### FIXED CODE ###

N,K=list(map(int,input().split()))
l=input()
n=l[0]
cnt=0
ans=[]
for i in l:
   if i != n:
      ans.append(cnt)
      cnt=1
      n=i
   else:
      cnt+=1
ans.append(cnt)
if l[0] == "0":
   sum_n=sum(ans[0:K*2])
   now=1
   end=K*2
   plus=0
else:
   sum_n=sum(ans[0:K*2+1])
   now=0
   end=K*2+1
   plus=1
max_n=sum_n
for i in range(len(ans)-end+plus):
   sum_n-=ans[i]
   if now==0:
      now=1
   else:
      try:
         sum_n=sum_n+ans[end]+ans[end+1]
         end+=2
      except IndexError:
         sum_n+=ans[end]
         max_n=max(sum_n,max_n)
         print(max_n)
         exit()
      now=0
   max_n=max(sum_n,max_n)
print(max_n)
import fractions
N,M=map(int,input().split())
S=input()
T=input()
lcm=(N*M)/fractions.gcd(N,M)
num=0
s=[]
t=[]
flag=1
for i in range(1):
    num=lcm*(i+1)
    st=[""]*int(num)
    for j in range(N):
        s.append([S[j],int(1+(num//N)*j)-1])
        st[int(1 + (num // N) * j)-1]=S[j]
    for j in range(M):
        t.append([T[j], int(1 + (num // M) * j) - 1])
        if st[int(1+(num//M)*j)-1]=="":
            st[int(1 + (num // M) * j)-1]=T[j]
        elif st[int(1+(num//M)*j)-1]!=T[j]:
            flag=0
            break
    if flag==1:
        break
    #print(s,t)
    s=[]
    t=[]
if flag==0:
    print("-1")
else:
    print(len(st))




### FIXED CODE ###

import fractions
N,M=map(int,input().split())
S=input()
T=input()
lcm=(N*M)/fractions.gcd(N,M)
num=0
s=[]
t=[]
flag=1
sindex=0
tindex=0
while (sindex<N)and(tindex<M):
    if S[sindex]!=T[tindex]:
        flag=0
        break
    sindex=sindex+(N//fractions.gcd(N,M))
    tindex = tindex + (M // fractions.gcd(N, M))
"""
for j in range(N):
    s.append([S[j],int(1+(num//N)*j)-1])
for j in range(M):
    t.append([T[j], int(1 + (num // M) * j) - 1])
#print(s,t)
while (sindex<N)and(tindex<M):
    #print(sindex,tindex)
    if s[sindex][1]==t[tindex][1]:
        if s[sindex][0]!=t[tindex][0]:
            flag=0
            break
        sindex=sindex+1
        tindex=tindex+1
    elif s[sindex][1]<t[tindex][1]:
        sindex=sindex+1
    else:
        tindex = tindex + 1
    #input()
"""
if flag==0:
    print("-1")
else:
    print(int(lcm))
A, B = map(int, input().split())
a = set(1)
b = set(1)
n = 2
while n**2 > max(A, B):
  if A%n == 0 and n**2 <= A:
    a.add(n)
    a.add(A//n)
  if B%n == 0 and n**2 <= B:
    b.add(n)
    b.add(B//n)
ab = a & b
ab = list(ab)
answer = 0
for i, n in enumerate(ab):
  prime = True
  for j, m in enumerate(ab):
    if i != j and n%m == 0:
      prime = False
      break
  if prime:
    answer += 1
print(answer)
      



### FIXED CODE ###

A, B = map(int, input().split())
a = set([])
b = set([])
n = 1
while n**2 <= max(A, B):
  if A%n == 0 and n**2 <= A:
    a.add(n)
    a.add(A//n)
  if B%n == 0 and n**2 <= B:
    b.add(n)
    b.add(B//n)
  n += 1
ab = a & b
ab.discard(1)
ab = list(ab)
answer = 0
for i, n in enumerate(ab):
  prime = True
  for j, m in enumerate(ab):
    if i != j and n%m == 0:
      prime = False
      break
  if prime:
    answer += 1
print(answer+1)
from itertools import accumulate as ac
N,K=map(int,input().split())
n=int(N**0.5)
mod=10**9+7
list_a=[1]*N_s
list_b=[N//j-N//(j+1) for j in range(1,N_s)]+[(N//n-n)]
list_p=[p for p in list_b]
list_aa=list(ac(list_a))
list_bb=list(reversed(list(ac(reversed(list_b)))))

for i in range(K-1):
    temp=sum(list_a)
    list_a=[(temp+list_bb[j])%mod for j in range(n)]
    list_b=[(list_p[j]*list_aa[j])%mod for j in range(n)]
    list_aa=list(ac(list_a))
    list_bb=list(reversed(list(ac(reversed(list_b)))))
    
print((sum(list_a+list_b))%mod)

### FIXED CODE ###

from itertools import accumulate
N,K=map(int,input().split())
N_s=int(N**0.5)
list_a=[1]*N_s
list_b=[N//j-N_s for j in range(1,N_s+1)]
list_p=[N//j-N_s for j in range(1,N_s+1)]
for p in range(1,len(list_p)):
        list_p[p-1]=list_p[p-1]-list_p[p]
        
for p in range(1,len(list_b)):
    list_b[p-1]=list_b[p-1]-list_b[p]

list_bb=list(reversed(list(accumulate(reversed(list_b)))))
list_aa=list(accumulate(list_a))

mod=10**9+7

for i in range(K-1):
    temp=sum(list_a)
    list_an=[(temp+list_bb[j])%mod for j in range(N_s)]
    list_bn=[(list_p[j-1]*list_aa[j-1])%mod for j in range(1,N_s+1)]

    list_bbn=list(reversed(list(accumulate(reversed(list_bn)))))
    list_aa=list(accumulate(list_an))
    list_a=list_an
    list_b=list_bn
    list_bb=list_bbn
    
print((sum(list_a)+sum(list_b))%mod)
print(x=input())
if (x <= 100) and (x >= 1):
    print(x ** 3)


### FIXED CODE ###

x = int(input())
#print(x)
print(x ** 3)
h,w,n=map(int,input().split())
dp=[[[0]*4 for _ in range(w+1)] for _ in range(h+1)]
v=[[0]*(w+1) for _ in range(h+1)]
for _ in range(n):
  r,c,f=map(int,input().split())
  v[r][c]=f
for i in range(1,h+1):
  for x in 0,1,2:
    for j in range(1,w+1):
      dp[i][j][x+1]=max(dp[i][j][x],max(dp[i][j+1][x],(x<1)*dp[i+1][j][3])+v[i][j],dp[i+1][j][x+1])
print(dp[-1][-1][-1])

### FIXED CODE ###

h,w,k=map(int,input().split())
dp=[[[0]*(w+2) for _ in range(h+2)] for _ in range(4)]
f=[[0]*(w+1) for _ in range(h+1)]
for _ in range(k):
  r,c,v=map(int,input().split())
  f[r][c]=v
for i in range(1,h+1):
  for j in range(1,w+1):
    for k in range(3,-1,-1):
      if k:dp[k][i][j]=max(dp[k][i][j],dp[k-1][i][j]+f[i][j])
      dp[0][i+1][j]=max(dp[0][i+1][j],dp[k][i][j])
      dp[k][i][j+1]=max(dp[k][i][j+1],dp[k][i][j])
print(max(dp[k][h][w] for k in range(4)))
count = int(input())
S=H=C=D=S2=H2=C2=D2 =[]
while True:
    if count == 0:
        break
    count -= 1
    x, y = map(str,input().split())
    if x == "S":
        S.append(y)
    elif x == "H":
        H.append(y)
    elif x == "C":
        C.append(y)
    elif x == "D":
        D.append(y)

for i in range(0,13):
    try:
        S.remove(str(i+1))
    except:
        S2.append(str(i+1))

for i in range(0,13):
    try:
        H.remove(str(i+1))
    except:
        H2.append(str(i+1))

for i in range(0,13):
    try:
        C.remove(str(i+1))
    except:
        C2.append(str(i+1))

for i in range(0,13):
    try:
        D.remove(str(i+1))
    except:
        D2.append(str(i+1))

for i in S2:
    print('S '+S2[i])
for i in H2:
    print('H '+H2[i])
for i in C2:
    print('C '+C2[i])
for i in D2:
    print('D '+D2[i])

### FIXED CODE ###

r=range
v=input
l=[i+" "+str(j)for i in"SHCD" for j in r(1,14)]
for i in r(int(v())):l.remove(v())
for i in l:print(i)
import sys

input = sys.stdin.readline


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def func(N, mod):
    F = [1]
    for i in range(1, N + 1):
        F.append(F[-1] * i % mod)
    return F


INV = {}


def inv(a, mod):
    if a in INV:
        return INV[a]
    r = pow(a, mod - 2, mod)
    INV[a] = r
    return r


def C(F, a, b, mod):
    return F[a] * inv(F[b], mod) * inv(F[a - b], mod) % mod


def main():
    N, W = read_values()
    I = [tuple(read_values()) for _ in range(N)]

    w0 = I[0][0]
    if w0 > W:
        print(0)
        return

    dp = [
        [[0 for _ in range(N * 3 + 100)] for __ in range(N + 10)]
        for ___ in range(N + 10)
    ]

    for i, (w1, v) in enumerate(I):
        w = w1 - w0
        for k in range(N):
            for j in range(N * 3 + 5):
                dp[i + 1][k][j] = max(dp[i][k][j], dp[i + 1][k][j])
                if j + w > N * 3 + 10:
                    continue
                dp[i + 1][k + 1][j + w] = max(dp[i][k][j] + v, dp[i + 1][k + 1][j + w])

    res = 0
    for k in range(N + 1):
        r = W - k * w0
        if r < 0:
            continue
        for i in range(W - k * w0 + 1):
            res = max(res, dp[N][k][i])
    print(res)


if __name__ == "__main__":
    main()



### FIXED CODE ###

import sys

input = sys.stdin.readline


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def func(N, mod):
    F = [1]
    for i in range(1, N + 1):
        F.append(F[-1] * i % mod)
    return F


INV = {}


def inv(a, mod):
    if a in INV:
        return INV[a]
    r = pow(a, mod - 2, mod)
    INV[a] = r
    return r


def C(F, a, b, mod):
    return F[a] * inv(F[b], mod) * inv(F[a - b], mod) % mod


def main():
    N, W = read_values()
    dp = [
        [[0 for _ in range(N * 3 + 10)] for __ in range(N + 10)]
        for ___ in range(N + 10)
    ]
    I = [tuple(read_values()) for _ in range(N)]

    w0 = I[0][0]
    if w0 > W:
        print(0)
        return

    for i, (w1, v) in enumerate(I):
        w = w1 - w0
        for k in range(N):
            for j in range(N * 3 + 5):
                dp[i + 1][k][j] = max(dp[i][k][j], dp[i + 1][k][j])
                dp[i + 1][k + 1][j + w] = max(dp[i][k][j] + v, dp[i + 1][k + 1][j + w])

    res = 0
    for k in range(N + 1):
        r = min(W - k * w0, 3 * N + 5)
        if r < 0:
            continue
        for i in range(r + 1):
            res = max(res, dp[N][k][i])
    print(res)


if __name__ == "__main__":
    main()
a, b = map(int,input())

if a >= 13:
  out = b
elif a >= 6:
  out = b/2
else:
  out = 0
print(out)

### FIXED CODE ###

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

if a >= 13:
  out = b
elif a >= 6:
  out = int(b/2)
else:
  out = 0
print(out)
def main():
    N = input()
    ans = 0
    for c in range(1, N):
        ans += solve(N-c)
    print(ans)

def solve(n):
    res = 0
    for i in range(1,n//2):
        if n % i == 0:
            res += 1
    return res

main()

### FIXED CODE ###


def main():
    N = int(input())
    ans = sum((N-1)//i for i in range(1, N))
    print(ans)

main()
i=0
 while 1:
  x = raw_input()
  if x == 0:
   break
  i+=1
  print "Case %d: %d" % (i,x)

### FIXED CODE ###

sum = 0
while 1:
   x = int(raw_input())
   sum = sum + 1
   if x == 0:
      break
   print 'Case %s: %s' %(sum, x)
total_subjects, max_points, target_points = map(int, input().split())
subject_points = input().split()
total_points = 0

for subject_point in subject_points:
    total_points += int(subject_point)

calc_result = total_subjects * target_points - total_points

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

### FIXED CODE ###

small_alpha = str(input())
alpha_list = [chr(ord('a') + i) for i in range(26)]
for num, alpha in enumerate(alpha_list):
    if alpha == small_alpha:
        print(alpha_list[num + 1])
a,b=int(input().split());print(a+b/2)

### FIXED CODE ###

a,b=map(int,input().split());print(a+b//2)
n=int(input())
a=list(map(int,input().split()))
a.sort()
cnt=0
data=[0]*max(a)
while cnt<n-1:
  if a[cnt]==a[cnt+1]:
    data[a[cnt]-1]+=1
    cnt+=2
  else:
    cnt+=1
data.reverse()
h=0
w=0
for i in range(len(data)):
  if data[i]==0:
    continue
  elif data[i]==1:
    if h==0:
      h=len(data)-i
    elif h!=0 and w==0:
      w=len(data)-i
  elif data[i]>=2:
    if h==0:
      h=len(data)-i
    if w==0:
      w=len(data)-i
  if h!=0 and w!=0:
    break
print(h*w)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
A=Counter(a)
s=set(a)
S=sorted(list(s))
S.reverse()
h=0
w=0
for i in S:
  res=A[i]
  if res>=4:
    if h==0:
      h=i
    if w==0:
      w=i
  elif 2<=res<4:
    if w==0:
      w=i
    elif w!=0 and h==0:
      h=i
print(h*w)
import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []
k = 0

for k in range(min(x), max(x)):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
  
print(min(ll))

### FIXED CODE ###

import numpy as np
N = int(input())
x = [int(i) for i in input().split() ]

each = 0
loss = 0
ll = []

for k in range(min(x), max(x)+1):
      for j in range(len(x)):
            each = np.power((x[j]-k), 2)
            loss += each
      ll.append(loss)
      loss = 0
  
print(min(ll))
N,A,B,C,D = map(int,input().split())
S = ['#']+list(input())
CanReach = True
CanChange = False
for i in range(A,C):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
for i in range(B,D):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
if C < D:
    CanChange = True
for i in range(B,D+1):
    if S[i-1] == '.' and S[i] == '.' and S[i+1] == '.':
        CanChange = True
if CanReach and CanChange:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N,A,B,C,D = map(int,input().split())
S = ['#']+list(input())
CanReach = True
CanChange = False
for i in range(A,C):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
for i in range(B,D):
    if S[i] == '#' and S[i+1] == '#':
        CanReach = False
if C < D:
    CanChange = True
else:
    for i in range(B,D+1):
        if S[i-1] == '.' and S[i] == '.' and S[i+1] == '.':
            CanChange = True
if CanReach and CanChange:
    print('Yes')
else:
    print('No')
n = int(input())
X = list(map(int, input().split()))
low = min(X)
high = max(X)
ans = []

for p in range(low, high-low+1):
  dist = 0
  for x in X:
    dist += (x-p)**2
  ans.append(dist)
print(min(ans))

### FIXED CODE ###

n = int(input())
X = list(map(int, input().split()))
low = min(X)
high = max(X)
ans = []

for p in range(low, high-low+1):
  dist = 0
  for x in X:
    dist += (x-p)**2
  ans.append(dist)
if len(ans) != 0:
  print(min(ans))
else:
  print(0)
for i in range(3001):

    x,y = map(int, input().split())

    if x == 0 and y == 0:
        break

    elif x => y:
        print(str(x) + " " + str(y))

    else:
        print(str(y) + " " + str(x))



### FIXED CODE ###

while True:
    x,y = map(int, input().split())

    if x == 0 and y == 0:
        break

    elif x <= y:
        print(str(x) + " " + str(y))
    else:
        print(str(y) + " " + str(x))
def fact(n, k):
  r1 = 1
  r2 = 1
  for i in range(0, k):
      r1 *= (n - i)
      r2 *= (i + 1)
  r = r1/r2
  return r

N,K = (int(x) for x in input().split())
R = N - K
mod = 1#0000007

for i in range(1,K+1):
  tmp1 = fact(R+1, i)  
  tmp2 = fact(K-1, i-1)
  ans = tmp1*tmp2%1000000007
  print(int(ans))


### FIXED CODE ###

import math
N,K = (int(x) for x in input().split())
R = N - K
mod = 10**9 + 7

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

for i in range(1,K+1):
  if N - K + 1 < i:
    ans = 0
  else:
    ans = fact(R+1, i)*fact(K-1,i-1)
  print(int(ans)%mod)
N, M = list(map(int, input().split()))
a = [int(input()) for _ in range(M)]

class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


MOD = 10 ** 9 + 7

for i in range(1, M):
  if a[i] - a[i - 1] == 1:
    print(0)
    exit()

com = comb(N, MOD)
ans = 1
x = 0
a = a + [N + 1]

for i in a:
  t = i - 1 - x
  at = 0
  for j in range(t // 2 + 1):
    k = t - j
    at = at + com.com(k, j) % MOD
  ans = ans * at % MODs
  x = i + 1
  

print(ans)

### FIXED CODE ###

N, M = list(map(int, input().split()))
a = [int(input()) for _ in range(M)]

class comb():
  F = [1, 1]
  Fi = [1, 1]
  I = [0, 1]
  def __init__(self, num, mod):
    self.MOD = mod
    for i in range(2, num + 1):
      self.F.append((self.F[-1] * i) % mod)
      self.I.append(mod - self.I[mod % i] * (mod // i) % mod)
      self.Fi.append(self.Fi[-1] * self.I[i] % mod)
  def com(self, n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return self.F[n] * (self.Fi[k] * self.Fi[n - k] % self.MOD) % self.MOD


MOD = 10 ** 9 + 7

for i in range(1, M):
  if a[i] - a[i - 1] == 1:
    print(0)
    exit()

com = comb(N, MOD)
ans = 1
x = 0
a = a + [N + 1]

for i in a:
  t = i - 1 - x
  at = 0
  for j in range(t // 2 + 1):
    k = t - j
    at = at + com.com(k, j) % MOD
  ans = ans * at % MOD
  x = i + 1
  

print(ans)
a, b = map(int, input())
if 8 < a or 8 < b:
  print(":(")
else:
  print("Yay!")


### FIXED CODE ###

a, b = map(int, input().split())
if 8 < a or 8 < b:
  print(":(")
else:
  print("Yay!")
N,A,B=map(int,input().split())
ans=0

for i in range(1,N+1):
  S=str(i)
  sum=0
  for num in S:
    sum += num
  if A<=sum and sum<=B:
    ans+= i
    
print(ans)

### FIXED CODE ###

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

for i in range(1,N+1):
  S=str(i)
  sum=0
  for num in S:
    sum += int(num)
  if A<=sum and sum<=B:
    ans+= i
    
print(ans)
a,b = input(),split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
else:
  print("H")

### FIXED CODE ###

a,b = input().split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
else:
  print("H")