Harryxun/stf_run huggingface dataset:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

H, W, D = MAP()
A = [LIST() for _ in range(H)]

dic = defaultdict(tuple)

for y in range(H):
	for x in range(W):
		dic[A[y][x]] = (y+1, x+1)

power = [[] for _ in range(D)]
for i in range(1, H*W+1):
	if i <= D:
		power[i%D].append(0)
	else:
		idx = i%D
		tmp = abs(dic[i][0]-dic[i-D][0]) + abs(dic[i][1]-dic[i-D][1])
		power[i%D].append(tmp)

power_acc = []
for x in power:
	power_acc.append(list(accumulate(x)))

Q = INT()
for _ in range(Q):
	L, R = MAP()
	print(power_acc[R%D][R//D] - power_acc[L%D][L//D])

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

H, W, D = MAP()
A = [LIST() for _ in range(H)]

dic = defaultdict(tuple)

for y in range(H):
	for x in range(W):
		dic[A[y][x]] = (y+1, x+1)

power = [[] for _ in range(D)]
for i in range(1, H*W+1):
	if i <= D:
		power[i%D].append(0)
	else:
		idx = i%D
		tmp = abs(dic[i][0]-dic[i-D][0]) + abs(dic[i][1]-dic[i-D][1])
		power[i%D].append(tmp)

#print(power)
power_acc = []
for x in power:
	power_acc.append(list(accumulate(x)))
#print(power_acc)

Q = INT()
for _ in range(Q):
	L, R = MAP()
	if L%D:
		print(power_acc[R%D][R//D] - power_acc[L%D][L//D])
	else:
		print(power_acc[R%D][R//D-1] - power_acc[L%D][L//D-1])
def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L = [0]*(n1+1)
    R = [0]*(n2+1)
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = float("inf")
    R[n2] = float("inf")
    i = 0
    j = 0
    for k in range(left,right): 
        if L[i] <= R[j]:
            c = c+1
            A[k] = L[i]
            i = i + 1
        else:
            c = c+1
            A[k] = R[j]
            j = j + 1

def mergeSort(A, left, right):
  if left+1 < right:
    mid = (left + right)//2;
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)
    
### Main Function
n = int(input())
S = list(map(int,input().split()))
c = 0

mergeSort(S, 0, n)

print(S)
print(c)



### FIXED CODE ###

def merge(A,left,mid,right):
    n1=mid-left
    n2=right-mid
    L = A[left:mid]
    R = A[mid:right]
    L.append(float("inf"))
    R.append(float("inf"))
    """
    L=[0]*(n1+1)
    R=[0]*(n2+1)
    for i in range(n1):
        L[i]=A[left+i]
    for i in range(n2):
        R[i]=A[mid+i]
    L[n1]=float("inf")
    R[n2]=float("inf")
    """
    i=0
    j=0
    for k in range(left,right):
        global cnt
        cnt+=1
        if L[i]<=R[j]:
            A[k]=L[i]
            i=i+1
        else:
            A[k]=R[j]
            j=j+1

def mergeSort(A,left,right):
    if left+1<right:
        mid=(left+right)//2
        mergeSort(A,left,mid)
        mergeSort(A,mid,right)
        merge(A,left,mid,right)

n=int(input())
S=list(input().split())
for i in range(n):
    S[i]=int(S[i])
cnt=0
mergeSort(S,0,n)
for i in range(n):
    if i==n-1:
        print(S[i])
    else:
        print(S[i],end=" ")
print(cnt)
class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2 2919"""
        output = """3719"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """22 3051"""
        output = """3051"""
        self.assertIO(input, output)


def resolve():
    N,R=map(int,input().split())
    print(R+max(0,10-N)*100)

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

def resolve():
    N,R=map(int,input().split())
    print(R+max(0,10-N)*100)

if __name__ == "__main__":
    resolve()
N,M,K = map(int,input().strip().split())
def judge(N,M,K):
    if K > N * M or K < 0:
        return False
    for n in range(0, N + 1):
        for m in range(0, M + 1):
            if n * M + m * N - m * n == K or:
                return True
    return False
if judge(N, M, K):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N,M,K = map(int,input().strip().split())
def judge(N,M,K):
    if K > N * M or K < 0:
        return False
    for n in range(0, N + 1):
        for m in range(0, M + 1):
            if n * M + m * N - 2*m * n == K:
                return True
    return False
if judge(N, M, K):
    print("Yes")
else:
    print("No")
while True:
    things = {}
    count = input()
    if count == 0: break
    for i in range(count):
        fuga = raw_input().split()
        things[fuga[0]] = int(fuga[1])
    for i in range(input()):
        fuga = raw_input().split()
        money =0
        for j in range(int(fuga[1])):
            money+= things[fuga[j+2]]
        things[fuga[0]] = things[fuga[0]] if money > things[fuga[0]] else money
    ans = raw_input()
    fin = things[ans] if ans in things else 0
    print fin

### FIXED CODE ###

q,w,e=range,input,raw_input
while True:
  n=w()
  if n==0:break
  d={}
  for i in q(n):
    o=e().split()
    d[o[0]]=int(o[1])
  for j in q(w()):
    t=e().split()
    a=sum([d[i] if i in d else 0 for i in t[2:]])
    d[t[0]]=a if a<d[t[0]] else d[t[0]]
  print d[e()]
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 50*i + 100*j = 500*k == X:
        ans += 1
print(ans)

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        ans += 1
print(ans)
def resolve():
    S = int(input())
    zeros = S.count("0")
    print(min(zeros, len(zeros)*2)

if '__main__' == __name__:
    resolve()

### FIXED CODE ###

def resolve():
    S = input()
    zeros = S.count("0")
    print(min(zeros, len(S)-zeros)* 2)

if '__main__' == __name__:
    resolve()
from sys import stdin
mod = 10**9+7
X,Y = [int(x) for x in stdin.readline().rstrip().split()]

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def power(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1

    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x % mod
        x *= x % mod
        n //= 2

    return K * x % mod

def div(a, b):
    return mul(a, power(b, mod-2))

def fact(n):
    f = 1
    for i in range(1,n+1):
        f *= i
        f %= mod
    return f

flag = True
x = 0
y = 0
x += min(X//3,Y//3)
y += min(X//3,Y//3)
tmp = min(X//3,Y//3)
X = X-tmp*3
Y = Y-tmp*3
if X == 0 and Y == 0:
    X = X
    Y = Y
elif (Y % (X*2) == 0):
    y += (Y//2)

elif (X % (Y*2) == 0):
    x += (X//2)
else:
    flag = False

if flag:
    ans = fact(x+y)
    ans = div(ans,fact(x))
    ans = div(ans,fact(y))
    print(ans)
    
else:
    print(0)

### FIXED CODE ###

from sys import stdin
import numpy as np
mod = 10**9+7
X,Y = [int(x) for x in stdin.readline().rstrip().split()]

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod
 
def power(x, n):
    """
    O(log n)
    """
    if n == 0:
        return 1
 
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x % mod
        x *= x % mod
        n //= 2
 
    return K * x % mod
 
def div(a, b):
    return mul(a, power(b, mod-2))
 
def fact(n):
    f = 1
    for i in range(1,n+1):
        f *= i
        f %= mod
    return f

if (X+Y) % 3 != 0:
    print(0)

else:
    A = np.matrix([[2, 1],[1, 2]])
    Y = np.matrix([[X],[Y]])
    x,y = np.linalg.solve(A,Y)
    x = int(x)
    y = int(y)
    ans = fact(x+y)
    ans = div(ans,fact(x))
    ans = div(ans,fact(y))
    if x < 0 or y <0:
        print(0)
    else:
        print(ans%mod)
import sys
from fractions import gcd


def eratosthenes_generator():
    yield 2
    n = 3
    h = {}
    while True:
        m = n
        if n in h:
            b = h[n]
            del h[n]
        else:
            b = n
            yield n
        m += b << 1
        while m in h:
            m += b << 1
        h[m] = b
        n += 2


def prime(n):
    ret = []
    if n % 2 == 0:
        ret.append(2)
        while n % 2 == 0:
            n >>= 1
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            ret.append(i)
            while n % i == 0:
                n = n // i
        if n == 1:
            break
    if n > 1:
        ret.append(n)
    return ret


def solve(n, aaa):
    g = abs(aaa[-1])
    for a in aaa[:-1]:
        if a != 0:
            g = gcd(g, abs(a))
    ans = set(prime(g))

    for p in prime(aaa[0]):
        if p > n + 2:
            break
        if p in ans or aaa[0] % p != 0:
            continue
        q = p - 1
        tmp = [0] * q
        for i, a in enumerate(aaa):
            tmp[i % q] += a
        if all(t % p == 0 for t in tmp):
            ans.add(p)

    ans = sorted(ans)
    return ans


n = int(input())
aaa = list(map(int, sys.stdin))
aaa.reverse()
print('\n'.join(map(str, solve(n, aaa))))


### FIXED CODE ###

import sys
from fractions import gcd


def eratosthenes_generator():
    yield 2
    n = 3
    h = {}
    while True:
        m = n
        if n in h:
            b = h[n]
            del h[n]
        else:
            b = n
            yield n
        m += b << 1
        while m in h:
            m += b << 1
        h[m] = b
        n += 2


def prime(n):
    ret = []
    if n % 2 == 0:
        ret.append(2)
        while n % 2 == 0:
            n >>= 1
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            ret.append(i)
            while n % i == 0:
                n = n // i
        if n == 1:
            break
    if n > 1:
        ret.append(n)
    return ret


def solve(n, aaa):
    g = abs(aaa[-1])
    for a in aaa[:-1]:
        if a != 0:
            g = gcd(g, abs(a))
    ans = set(prime(g))

    for p in eratosthenes_generator():
        if p > n + 2:
            break
        if p in ans or aaa[0] % p != 0:
            continue
        q = p - 1
        tmp = [0] * q
        for i, a in enumerate(aaa):
            tmp[i % q] += a
        if all(t % p == 0 for t in tmp):
            ans.add(p)

    ans = sorted(ans)
    return ans


n = int(input())
aaa = list(map(int, sys.stdin))
aaa.reverse()
print('\n'.join(map(str, solve(n, aaa))))
n = int(input())
h = list(map(int,input().split()))
l = [0,0,0]


for i in range(n-1):
  if h[i] >= h[i + 1]:
    l.insert(i, 1)
 
con = 0
max = 0
for i in range(n + 1):
  if l[i] == 1:
    con += 1
  else:
    if con > max:
      max = con
      con = 0
print(max)

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
l = [0,0,0]
for i in range(n-1):
  if h[i] >= h[i + 1]:
    l.insert(i, 1)
  else:
    l.insert(i,0)

con = 0
max = 0
for i in range(n + 1):
  if l[i] == 1:
    con = con + 1
  else:
    if con > max:
      max = con
    con = 0
print(max)
X = input()
# X = 'SSTTST'
# X = 'TSSTTTSS'

# naive case
# len_prev = -1
# while len_prev != len(X):
#     len_prev = len(X)
#     X = X.replace('ST', '')
# print(len(X))


i = 0
cnt = []
X += " "
cur = 1
for i in range(len(X) - 1):
    if X[i] == X[i + 1]:
        cur += 1
    else:
        cnt.append((X[i], cur))
        cur = 1

total = 0
for i in range(len(cnt) - 1):
    if cnt[i][0] == 'S':
        if cnt[i][1] > cnt[i + 1][1]:
            if i + 2 < len(cnt) - 1:
                cnt[i + 2][1] += cnt[i][1] - cnt[i + 1][1]
        total += min(cnt[i][1], cnt[i + 1][1])
print(len(X) - 1 - 2 * total)


### FIXED CODE ###

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

x = input()
n = len(x)

s, t = 0, 0
cnt = 0
for i in range(n):
    if x[i] == 'T':
        if s > 0:
            s -= 1
            cnt += 2
    elif x[i] == 'S':
        s += 1

# i = 0
# s = 0
# t = 0
# cnt = 0
# while i < n:
#     while i < n and x[i] == 'T':
#         i += 1
#         t += 1
#     tmp = min(t, s)
#     cnt += tmp * 2
#     if t - tmp == 0:
#         s -= tmp
#     else:
#         s = 0
#         t = 0

#     while i < n and x[i] == 'S':
#         i += 1
#         s += 1
print(n - cnt)
s, e = map(int,input().split())
mn = min(map(lambda x:x%2019,range(s,e+1)))
for i in range(s, e+1):
  ans = min(ans, mn*i)
print(ans)

### FIXED CODE ###

s, e = map(int, input().split())
ans = 10 ** 9
b = min(s+2019, e)
for i in range(s, b + 1):
    for j in range(i+1, b+1):
        ans = min(ans, i*j%2019)
print(ans)
pattern_sum = 0
a_list = input().split()
while a_list[0]!='0' or a_list[1]!='0':
    for i in range(1,int(a_list[0])-1):
        for j in range(i+1,int(a_list[0])):
            for k in range(j+1,int(a_list[0])+1):
                if i+j+k == int(a_list[1]):
                    pattern_sum+=1
    print(pattern_sum)
    a_list = input().split()

### FIXED CODE ###

if __name__ == '__main__':
    a_list = [int(f) for f in raw_input().split()]
    while a_list[0]!=0 or a_list[1]!=0:
        pattern_sum = 0
        for i in range(1,a_list[0]-1):
            for j in range(i+1,a_list[0]):
                for k in range(j+1,a_list[0]+1):
                    if i+j+k == a_list[1]:
                        pattern_sum+=1
        print pattern_sum
        a_list = [int(f) for f in raw_input().split()]
n, k = map(int, input().split())
p = list(map(int, input().split()))

p.sort()

ans = p[:k].sum()
  
print(ans)

### FIXED CODE ###

inp1 = input()
inp2 = input()

lists1 = inp1.split()
lists2 = inp2.split()

N = int(lists1[0])
K = int(lists1[1])
values = sorted([int(i) for i in lists2])

result = sum(values[:K])

print(result)
n=int(raw_input())
a=map(int,raw_input().split())
#color=[hai,cha,midori,mizu,ao,ki,daidai,aka]
c=[0 for i in xrange(8)]
ext=0
for x in a:
 if 1<=x<=399:
  c[0]+=1
 elif 400<=x<=799:
  c[1]+=1
 elif 800<=x<=1199:
  c[2]+=1
 elif 1200<=x<=1599:
  c[3]+=1
 elif 1600<=x<=1999:
  c[4]+=1
 elif 2000<=x<=2399:
  c[5]+=1
 elif 2400<=x<=2799:
  c[6]+=1
 elif 2800<=x<=3199:
  c[7]+=1
 else:
  ext+=1
print c
res1=len(c)-c.count(0)
res2=min(res1+ext,len(c))
print res1,res2


### FIXED CODE ###

#ABC064A

r,g,b=raw_input().split()
if int(r+g+b)%4:
 print 'NO'
else:
 print 'YES'
N,M,C = map(int, input().split())
B = list(map(int, input().split()))
A = []
counter = 0
for i in range(N):
    A.append(list(map(int, input().split())))
    val = 0
    for j in range(M):
        val += A[i][j] * B[j]
    else:
        if val + C > 0:
            count += 1 
print(count)


### FIXED CODE ###

N,M,C = map(int, input().split())
B = list(map(int, input().split()))
A = []
counter = 0
for i in range(N):
    A.append(list(map(int, input().split())))
    val = 0
    for j in range(M):
        val += A[i][j] * B[j]
    else:
        if val + C > 0:
            counter += 1 
print(counter)
from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
A_count = Counter(A)
count_item = list(A_count.items())
count_item.sort()
start = 1 - (N % 2)
for i in range(math.ceil(N / 2)):
    if i == 0 and N % 2 == 1:
        if count_item[i][0] == 0 and count_item[i][1] != 1:
            print("0")
            exit()
    else:
        if count_item[i][0] != i * 2 + (1 - (N % 2)) or count_item[i][1] != 2:
            print("0")
            exit()
print(2 ** (N // 2) % (10 ** 9 + 7)

### FIXED CODE ###

from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
A_count = Counter(A)
count_item = list(A_count.items())
count_item.sort()
start = 1 - (N % 2)
for i in range(math.ceil(N / 2)):
    if i == 0 and N % 2 == 1:
        if count_item[i][0] == 0 and count_item[i][1] != 1:
            print("0")
            exit()
    else:
        if count_item[i][0] != i * 2 + (1 - (N % 2)) or count_item[i][1] != 2:
            print("0")
            exit()
print(2 ** (N // 2) % (10 ** 9 + 7))
import heapq
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
  a[i] = -a[i]
heapq.heapify(a)

for _ in range(m):
  x = heapq.heappop(a)
  x = -1 * (-1 * x // 2)
  heapq.heappush(x, a)
print(-sum(a))

### FIXED CODE ###

import heapq
n,m = map(int,input().split())
a = list(map(int,input().split()))
for i in range(n):
  a[i] = -a[i]
heapq.heapify(a)

for _ in range(m):
  x = heapq.heappop(a)
  x = -1 * (-1 * x // 2)
  heapq.heappush(a, x)
print(-sum(a))
n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
answer = [0] * n

for i in range(n - 1):
  answer[a[i] - 1] += 1
    
for i in range(n):
  print(answer[i])
def main():
    N, A = map(int, input().split())
    x = [0].extend(list(map(int, input().split())))

    dp = [[[0 for _ in range(N * A + 1)] for _ in range(N + 1)] for _ in range(N + 1)]
    for i in range(N + 1):
        dp[i][0][0] = 1

    for i in range(1, N + 1):
        for j in range(1, i + 1):
            for k in range(1, N * A + 1):
                if k < x[k]:
                    dp[i][j][k] = dp[i - 1][j][k]
                else:
                    dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i]]

    ans = 0
    for j in range(1, N + 1):
        ans += dp[N][j][A * j]

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

if __name__ == '__main__':
    N, A = map(int, input().split())
    x = list(map(int, input().split()))

    x.insert(0, 0)

    dp = [[[0 for _ in range(N * A + 1)] for _ in range(N + 1)] for _ in range(N + 1)]
    for i in range(N + 1):
        dp[i][0][0] = 1

    for i in range(1, N + 1):
        for j in range(1, i + 1):
            for k in range(1, N * A + 1):
                dp[i][j][k] = dp[i - 1][j][k]
                if k >= x[i]:
                    dp[i][j][k] += dp[i - 1][j - 1][k - x[i]]

    ans = 0
    for j in range(1, N + 1):
        ans += dp[N][j][A * j]

    print(ans)
N = int(input())
ans = 0
if N < 105:
  pass
else:
  for i in range(105, N+1, 2):
    cnt = 0
    for j in range(1, N+1):
      if i % j == 0:
        cnt += 1
    if cnt == 8:
      ans += 1
      
print(ans)  



### FIXED CODE ###

A, B = map(int, input().split())
print((A-1)*(B-1))
s = input()
ans = 0
for i in range((len(s) - 1) ** 2):
    tmp = ''
    for j in range(len(s)):
        tmp += s[j]
        if i >> j & 1:
            tmp += '+'
    else:
        ans += eval(tmp)
else:
    print(ans)

### FIXED CODE ###

def main():
    s = input()
    ans = 0
    for i in range(2 ** (len(s) - 1)):
        tmp = ""
        for j in range(len(s)):
            tmp += s[j]
            if(j < len(s) - 1):
                if (i >> j) & 1:
                    tmp += "+"
        else:
            #print("i =", i, " ", ans, "+", tmp, "=", end = "")
            ans += eval(tmp)
    else:
        print(ans)

if __name__ == "__main__":
    main()
import sys
def input():
    return sys.stdin.readline()[:-1]

alphabet = "abcdefghijklmnopqrstuvwxyz"
a_len = len(alphabet)
table = {c: idx for idx, c in enumerate(alphabet)}

s = input()
k = int(input())

ans = ""
for i in range(len(s[:-1])):
    gap = a_len - table[s[i]]
    if gap <= k:
        ans += "a"
        k -= gap
    elif k == 0:
        ans += s[i:-1]
    else:
        ans += s[i]

ans += alphabet[(table[s[-1]] + k) % a_len]
print(ans)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    s = rl().rstrip()
    K = int(rl())
    
    ans = []
    for si in s:
        if si == 'a':
            ans.append('a')
            continue
        cnt = ord('z') - ord(si) + 1
        if cnt <= K:
            ans.append('a')
            K -= cnt
        else:
            ans.append(si)
    
    ans[-1] = chr(ord('a') + (ord(ans[-1]) - ord('a') + K % 26) % 26)
    print(''.join(ans))


if __name__ == '__main__':
    solve()
S = include()
a = "Sunny"
b = 'Cloudy'
c = 'Rainy'
if S == a:
    print(b)
elif S == b:
        print(c)
elif S == b:
        print(a)
else

exit()

### FIXED CODE ###

import sys
S = input()
a = "Sunny"
b = 'Cloudy'
c = 'Rainy'
if S == a:
    print(b)
elif S == b:
        print(c)
elif S == c:
        print(a)
else:
    sys.exit()
sys.exit()
n,k = map(int,input().split())
l = list(map(int,input()))

l.sort()

print(l[-1]+l[-2]+l[-3])

### FIXED CODE ###

n,k = map(int,input().split())
l = list(map(int,input().split()))

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)
import numpy

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

lcm = int(a * b / numpy.gcd(a, b))
print(lcm)


### FIXED CODE ###

import fractions

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

lcm = int(a * b / fractions.gcd(a, b))
print(lcm)
N = int(input())
T, X, Y = 0, 0, 0
count = 0
for i in range(N):
  t, x, y = map(int, input().split())
  dt = t - T
  dist = abs(x - X) + abs(y - Y)
  if dist <= dt and t%2 == (x+y)%:
    count += 1
  T, X, Y = t, x, y
print('Yes' if count == N else 'No')
    
  
  

       

### FIXED CODE ###

N = int(input())
T, X, Y = 0, 0, 0
count = 0
for i in range(N):
  t, x, y = map(int, input().split())
  dt = t - T
  dist = abs(x - X) + abs(y - Y)
  if dist <= dt and t%2 == (x+y)%2:
    count += 1
  T, X, Y = t, x, y
print('Yes' if count == N else 'No')
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    if a > b:
        print(f"b a"")
    else:
        print(f"a b"")



### FIXED CODE ###

while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    elif a > b:
        print(f'{b} {a}')
    else:
        print(f'{a} {b}')