Harryxun/stf_run huggingface dataset:
import sys
import bisect
import math
input = sys.stdin.readline

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

mc = max(l)[1]
mc_sqrt = math.sqrt(mc)

prime = [i for i in range(2, mc + 1)]
c = 0
while True:
    if c >= len(prime):
        break
    t = prime[c]
    prime = [v for v in prime if v == t or v % t != 0]
    c = c + 1
    if c >= mc_sqrt:
        break
        
cum = [0 for i in range(mc + 1)]
for i in range(len(cum)):
    prime_index = bisect.bisect_left(prime, i)
    
    n2 = (i + 1) / 2
    prime_index2 = bisect.bisect_left(prime, n2)
    if len(prime) > prime_index and len(prime) > prime_index2 and prime[prime_index] == i and prime[prime_index2] == n2:
        cum[i] = cum[i - 1] + 1
    else:
        if i - 1 < 0:
            cum[i] = 0
        else:
            cum[i] = cum[i - 1]
        
for x, y in l:
    p = cum[x] - cum[x - 1]
    if x != y:
        p += cum[y] - cum[x]
    print(p)


### FIXED CODE ###

import sys
import bisect
import math
input = sys.stdin.readline

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

mc = 0
for v in l:
    mc = max(mc, v[1])
mc_sqrt = math.sqrt(mc)

prime = [i for i in range(2, mc + 1)]
c = 0
while True:
    if c >= len(prime):
        break
    t = prime[c]
    prime = [v for v in prime if v == t or v % t != 0]
    c = c + 1
    if c >= mc_sqrt:
        break
        
cum = [0 for i in range(mc + 1)]
for i in range(len(cum)):
    prime_index = bisect.bisect_left(prime, i)
    
    n2 = (i + 1) / 2
    prime_index2 = bisect.bisect_left(prime, n2)
    if len(prime) > prime_index and len(prime) > prime_index2 and prime[prime_index] == i and prime[prime_index2] == n2:
        cum[i] = cum[i - 1] + 1
    else:
        if i - 1 < 0:
            cum[i] = 0
        else:
            cum[i] = cum[i - 1]

for t in l:
    x, y = t[0], t[1]
    p = 0
    if 0 <= x - 1:
        p = cum[x] - cum[x - 1]
    if x != y:
        p += cum[y] - cum[x]
    print(p)
import math
N,M = map(int,input().split())

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

if N !=0 and N != 1:
    a = combinations_count(N, 2)
else:
    a = 0

if M !=0 and M != 0:
    b = combinations_count(M, 2)
else:
    b = 0

print(a+b)

### FIXED CODE ###

import math
N,M = map(int,input().split())

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

if N !=0 and N != 1:
    a = combinations_count(N, 2)
else:
    a = 0

if M !=0 and M != 1:
    b = combinations_count(M, 2)
else:
    b = 0

print(a+b)
n = input()
n = int(n)
lin = input().split()
# 要素の個数を求める
dic_s = {}
for c in lin:
  dic_s.setdefault(c, 0)
  dic_s[c] += 1
# 1つしかない要素は計算対象外
for key, value in dic_s.items():
  if value == 1:
    del dic_s[key]
dic_tot = {}
for c in lin:
  # 1度求めたら再計算しない
  # 同じ数字が多いと時間短縮
  if dic_tot.get(c):
    print(int(dic_tot[c]))
  else:
    # 指定数値を除いた2つを選ぶ
    tot = 0
    for key,value in dic_s.items():
      v = value
      if key == c:
        v -= 1
      if v > 1:
        tot += v * (v - 1) / 2
    dic_tot.setdefault(c,tot)
    print(int(tot))

### FIXED CODE ###

n = input()
n = int(n)
lin = input().split()
# 要素の個数を求める
dic_s = {}
for c in lin:
  dic_s.setdefault(c, 0)
  dic_s[c] += 1
# ペアの総数
tot = 0
for key,value in dic_s.items():
  v = value
  tot += v * (v - 1) / 2
# print(int(tot))
# 指定位置のペアを除く
for c in lin:
  if tot > 0:
    v = dic_s[c]
    print(int(tot-(v-1)))
  else:
    print(0)
if __name__ == '__main__':
    N = int(input())
    l = [list(map(int, input())) for i in range(N)]
    # l = [10, 8, 8, 6]
    s = set(l)
    print(len(s))


### FIXED CODE ###

if __name__ == '__main__':
    N = int(input())
    l = [int(input()) for i in range(N)]
    # l = [10, 8, 8, 6]
    s = set(l)
    print(len(s))
import sys
sys.setrecursionlimit(400000000)
def main():
    n,k=map(int,input().split())
    h=tuple(map(int,input().split()))
    flog=[-1]*n
    #初期値は0
    def Num(dest,flog,h):
        q=dest-1
        if flog[q]>0:
            return flog[q]
        if dest<k+2:
            res=abs(h[q]-h[0])
            flog[q]=res
            return res
        
        min=Num(q)+abs(h[q]-h[q-1])
        for i in range(2,k+1):
            tmp=Num(dest-i)+abs(h[q]-h[q-i])
            if min>tmp:
                min=tmp
        flog[q]=min
        return min   
    print(Num(n,flog,h))
if __name__=="__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(400000000)
def main():
    n,k=map(int,input().split())
    h=tuple(map(int,input().split()))
    flog=[-1]*n
    for i in range(n):#dest=i 0が１
        if i<k+1:#0~k
            flog[i]=abs(h[i]-h[0])
        else:
            min=10**9
            for j in range(1,k+1):#1~k
                tmp=flog[i-j]+abs(h[i]-h[i-j])
                if tmp<min:
                    min=tmp
            flog[i]=min
    print(flog[n-1])
   # print(flog)
if __name__=="__main__":
    main()
import math
a, b, x = list(map(float, input().split()))

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    print(90-math.degrees(math.atan(   (a/(b-y))  )))
else:
    # 三角形
    print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))

### FIXED CODE ###

import math
a, b, x = list(map(float, input().split()))

# %%
# a, b, x = [3, 1, 8]
if x/a > a*b/2:
    # 台形
    y = 2*x/(a**2) - b
    # print(90-math.degrees(math.atan(   (a/(b-y))  )))
    print(90-math.degrees(math.atan2(a, b-y)))
else:
    # 三角形
    # print(90-math.degrees(math.atan( (2*x/(a*b)) / b  )))
    print(90-math.degrees(math.atan2(2*x/(a*b), b)))
import sys
import math
def resolve():
    S=input().rstrip()
    c=0
    for i in range((len(S)/2)):
        if(S[i]!=S[-i-1]):
            c+=1
    print(c)

from io import StringIO
import unittest

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 = """redcoder"""
        output = """1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """vvvvvv"""
        output = """0"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """abcdabc"""
        output = """2"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()

### FIXED CODE ###


import sys
import math
def resolve():
    S=list(input().rstrip())
    c=0
    for i in range(math.floor(len(S)/2)):
        if(S[i]!=S[len(S)-i-1]):
            c+=1
    print(c)

from io import StringIO
import unittest

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 = """redcoder"""
        output = """1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """vvvvvv"""
        output = """0"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """abcdabc"""
        output = """2"""
        self.assertIO(input, output)

if __name__ == "__main__":
    #unittest.main()
    resolve()
S=input()

if S = 'SUN':
    print(7)
else if S == 'MON':
    print(6)
else if S == 'TUE':
    print(5)
else if S == 'WED':
    print(4)
else if S == 'THS':
    print(3)
else if S == 'FRI':
    print(2)
else if S == 'SAT':
    print(1)


### FIXED CODE ###

S=input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
N, M = map(int, input().split())
A = list(map(int, input().split()))
honsuu = [0,2,5,5,4,5,6,3,7,6]
aval = []
for a in A:
  aval += [honsuu[a]]
aval.sort()

dp = [0] 
# i 本のマッチで作れる最高の桁数
for i in range(1,N+1):
  for b in aval:
    if i < b:
      continue
    else:
      dp += [dp[i-b] + 1]
      break
  else:
    dp += [0]

#作れる桁数はdp[-1]=dp[N] で, 最高桁にi が使えるかどうかの条件は, 
#a in A かつ dp[N- honsuu[a]] = dp[N] -1
A.sort(reverse=True)
ans = []
for i in range(dp[N],1,-1):
  for a in A:
    if N - honsuu[a] < 0:continue
    if dp[N - honsuu[a]] == dp[N] - 1:
      N -= honsuu[a]
      ans += [a]
      break
      
final = 0
for i in range(10):
  if i in A and honsuu[i] == N:
    final = i
    break
ans += [final]
print(''.join(map(str, ans)))

### FIXED CODE ###

A, B = map(int, input().split())
if B%A == 0:
  print(A+B)
else:
  print(B-A)
if h == 1 or w == 1:
    print(1)
elif h % 2 == 0:
    print(int(h*w/2))
elif h % 2 == 1 and w % 2 == 0:
    print(int(h*w/2))
else:
    print(int(h*(w//2)+h//2+1))

### FIXED CODE ###

h,w = map(int,input().split())
 
if h == 1 or w == 1:
    print(1)
elif h % 2 == 0:
    print(int(h*w/2))
elif h % 2 == 1 and w % 2 == 0:
    print(int(h*w/2))
else:
    print(int(h*(w//2)+h//2+1))
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7

# case1. N == K のときは答えは確定
if N == K:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
# case2. A が全部負の数のとき、 Kが奇数ならば残念ながら答えは負になるのでなるべく絶対値を小さくする
elif max(A) < 0 and K % 2 == 1:
    ans = 1
    A = sorted(A, reverse=True)
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
else:
    # case3. それ以外は正にできるので、絶対値の降順にソートする
    A_ = sorted(A, key=lambda x: abs(x), reverse=True)
    # とりあえず大きい順に K 個掛けてみる
    ans = 1
    for i in range(K):
        ans *= A[i]
    if ans >= 0:
        ans %= MOD
        print(ans)
    else:
        # 取り除く対象を old, 取り込む対象を new とする
        # case3-1. 負数を取り除いて非負数を取り込む
        # まずは new を探す
        j = K
        while j < N or A[j] < 0:
            j += 1
        if j < N:
            new1 = A[j]
        # old を探す
        l = K-1
        while A[l] >= 0:
            l -= 1
        old1 = A[l]
        if new1 and old1:
            cand1 = ans * pow(old1, MOD-2, MOD) * new1
        # case3-2. 非負数を取り除いて負数を取り込む
        # まずは new を探す
        j = K
        while j < N or A[j] >= 0:
            j += 1
        if j < N:
            new2 = A[j]
        # old を探す
        l = K-1
        while A[l] < 0:
            l -= 1
        old2 = A[l]
        if new2 and old2:
            cand2 = ans * pow(old2, MOD-2, MOD) * new2

        if cand1 and cand2:
            print(cand1, cand2)
            ans = max(cand1, cand2) % MOD
        elif cand1:
            ans = cand1 % MOD
        else:
            ans = cand2 % MOD
        print(ans)


### FIXED CODE ###

from heapq import heappush, heappop


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

MOD = 10**9 + 7

# case1. N == K のときは答えは確定
if N == K:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
# case2. A が全部負の数のとき、 Kが奇数ならば残念ながら答えは負になるのでなるべく絶対値を小さくする
elif max(A) < 0 and K % 2 == 1:
    ans = 1
    for i in range(K):
        ans *= A[i]
        ans %= MOD
    print(ans)
else:
    # case3. それ以外は正にできる

    # K が奇数のとき、非負要素から1つ取って偶数の場合に帰着
    # K が偶数のとき、面倒なので 2 つセットで考えて K//2 個取る問題に帰着

    if K%2 == 1:
        ans = A.pop(0)  # あらかじめ最大値を確保
        n = (K-1)//2
    else:
        ans = 1
        n = K//2

    # 絶対値の降順にソートする
    A = sorted(A, key=lambda x: abs(x), reverse=True)

    # 候補テーブルを作成
    cand = []  # 非負要素、負要素をそれぞれ絶対値の大きい順に 2 つずつ掛けたもの

    BIGINT = 10**9 + 1  # tmp 用
    tmp1 = BIGINT
    tmp2 = BIGINT

    for a in A:
        if a >= 0:
            if tmp1 == BIGINT:
                tmp1 = a
            else:
                heappush(cand, -tmp1*a)
                tmp1 = BIGINT
        else:
            if tmp2 == BIGINT:
                tmp2 = a
            else:
                heappush(cand, -tmp2*a)
                tmp2 = BIGINT

    # あとは大きい方から n 個取る
    for i in range(n):
        ans *= -heappop(cand)
        ans %= MOD
    print(ans)
A = int(input().strip().split())
B = int(input().strip().split())
C = int(input().strip().split())
X = int(input().strip().split())

k = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c == X:
        k += 1

print(k)


### FIXED CODE ###

A = int(input().strip())
B = int(input().strip())
C = int(input().strip())
X = int(input().strip())

k = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if 500 * a + 100 * b + 50 * c == X:
        k += 1

print(k)
#bit & 演算子は同じ位置のbitが１の時１を返す

def main():
    n, m = map(int, input().split())
    # ｋは何個のスイッチにつながっているか、ｓはスイッチの番号
    s = []; k = [] # s : どのスイッチとつながってるか、インデックスは電球を指す、　k: 電球が何個のスイッチとつながっているか
    for _ in range(m):
        tmp_k, *tmp_s = list(map(int, input().split()))
        k.append(tmp_k); s.append(tmp_s)
    p = list(map(int, input().split()))

    res = 0
    # スイッチの状態は２進数表記で表す。スイッチはｎ個あるので
    for bit in range(2**n):
        ok = True
        for i in range(m): # 各電球に対して見ていく
            cnt = 0
            for v in s[i]: # 各電球につながっているスイッチを見てる
                if ( bit & 1 << (v - 1) ): # bitの状態がスイッチvがついてる状態なのかどうか
            if cnt % 2 != p[i]:
                ok = False
        if ok: # okなら全ての電球が付いているということ
            res += 1

    print(res)

if __name__ == "__main__":
    main()

### FIXED CODE ###

#bit & 演算子は同じ位置のbitが１の時１を返す
def main():
    n, m = map(int, input().split())
    # ｋは何個のスイッチにつながっているか、ｓはスイッチの番号
    s = []; k = [] # s : どのスイッチとつながってるか、インデックスは電球を指す、　k: 電球が何個のスイッチとつながっているか
    for _ in range(m):
        tmp = list(map(int, input().split()))
        s.append(tmp[1:]); k.append(tmp[0])
    p = list(map(int, input().split()))

    res = 0
    # スイッチの状態は２進数表記で表す。スイッチはｎ個あるので
    for bit in range(2**n):
        ok = True
        for i in range(m): # 各電球に対して見ていく
            cnt = 0
            for v in s[i]: # 各電球につながっているスイッチを見てる
                if ( bit & 1 << (v - 1) ): # bitの状態がスイッチvがついてる状態なのかどうか
                    cnt += 1
            if cnt % 2 != p[i]:
                ok = False
        if ok: # okなら全ての電球が付いているということ
            res += 1

    print(res)

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

def luc(n):
  if n = 0:
    return 2
  elif n = 1:
    return 1
  else:
    return luc(n-1) + luc(n-2)

print(luc(a))

### FIXED CODE ###

n=int(input())
a, b = 2, 1
for i in range(n-1):
  a, b = b, a + b
  
print(b)
import math
A,B,C = map(int, input().split())
K = int(input())
if A < B:
  K1 = math.ceil(math.log(A,B))
  B = B ** K1
elif A == B:
  K1 = 2
  B = B ** K1
else
  K1 = 1

if B < C:
  K2 = math.ceil(math.log(B,C))
elif B == C:
  K2= 2
else
  K2= 1
if K1 + K2 -2 <= K:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import math
A,B,C = map(int, input().split())
K = int(input())
if A > B:
  K1 = math.ceil(math.log(A/B,2))
  B = B * (2 ** K1)
  if A == B:
    B = B * 2
    K1 = K1 + 1
elif A == B:
  B = B * 2
  K1 = 1
else:
  K1 = 0

if B > C:
  K2 = math.ceil(math.log(B/C,2))
  C = C * (2 ** K2)
  if C == B:
    K2 = K2 + 1
elif B == C:
  K2= 1
else:
  K2= 0
  
if K1 + K2 <= K:
  print('Yes')
else:
  print('No')
a,b = map(int,input())
x = (a+b)//2
print(x)

### FIXED CODE ###

a,b = map(int,input().split())
x = (a+b+1)//2
print(x)
def main():
    [N, M] = [int(i) for i in input().split()]

    E = []

    for i in range(M):
        E.append([int(i) for i in input().split()])

    dist = [-1*10**100 for i in range(N)]
    dist[0] = 0

    for i in range(N):
        for [a, b, c] in E:
            newLen = dist[a-1] + c
            if newLen > dist[b-1]:
                dist[b-1] = newLen

    dist2 = dist.copy()

    for i in range(N):
        for [a, b, c] in E:
            newLen = dist2[a-1] + c
            if newLen > dist2[b-1]:
                dist2[b-1] = newLen

    if dist != dist2:
        print('inf')
    else:
        print(dist[N-1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    [N, M] = [int(i) for i in input().split()]
    edge = [[10**100] * N for _ in range(N)]

    E = []

    for i in range(M):
        E.append([int(i) for i in input().split()])

    dist = [-1*10**100 for i in range(N)]
    dist[0] = 0

    flag = False

    for i in range(N):
        for [a, b, c] in E:
            newLen = dist[a-1] + c
            if newLen > dist[b-1]:
                dist[b-1] = newLen
        if i == N-1 and dist[N-1] > predist:
            flag = True
        predist = dist[N-1]

    if flag:
        print('inf')
    else:
        print(dist[N-1])


if __name__ == '__main__':
    main()
#include <iostream>
 
int main(void)
{
  int x,t;
  std::cin >> x >> t;
  x = std::max<int>(0,x-t);
  std::cout << x << std::endl;
  return 0;
}

### FIXED CODE ###

X, t = map(int,input().split())
if X >= t:
  print(X-t)
else:
  print(0)
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(n):
  if (i == 0):
    ans =b[a[0] - 1]
    y = a[0]
  else:
    x = a[i]
    if (x - y == 1):
      ans = ans + b[x - 1] + c[x - 1]
    else:
      ans = ans + b[x - 1]
    y = x

print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(n):
  if (i == 0):
    ans =b[a[0] - 1]
    y = a[0]
  else:
    x = a[i]
    if (x - y == 1):
      ans = ans + b[x - 1] + c[y - 1]
    else:
      ans = ans + b[x - 1]
    y = x

print(ans)
n = int(input())
t = list(map(int,input().split()))
m = int(input())
px = [list(map(int,input().split())) for _ in range(m)]

for i in range(m):
    print(sum(t)-t[px[i][0]]+px[i][1])

### FIXED CODE ###

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

for i in range(m):
    print(sum(t)-t[px[i][0]-1]+px[i][1])
import numpy as np
n = int(input())

l = np.empty(n)
l[:] = np.nan
k = 0
for i in range(n):
  if n % i == 0:
    l[k] = int(i + (n / i))
    k += 1
print(np.min(l))

### FIXED CODE ###

n = int(input())

for i in range(int(n ** 0.5)):
  if n % (int(n ** 0.5) - i) == 0:
    j = n // (int(n ** 0.5) - i)
    break
    
print(int(n ** 0.5) - i + j - 2)
n = int(input())
A = list(map(int, input().split()))
A.sort()
#print(A)

d = {}
for i in range(n):
    a = A[i]
    for k in (-1, 0, 1):
        if a+k not in d:
            d[a+k] = 1
        else:
            d[a] += 1
max_ = 0
for v in d.values():
    if v >= max_:
        max_ = v
print(max_)


### FIXED CODE ###

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

d = {}

for i in range(max(a)+1):
  d[i] = 0

for a_ in a:
  d[a_] += 1

d[-1] = 0
d[max(a)+1] = 0

ans = 0

for x in range(max(a)+1):
  if x-1 in d:
    ans = max(ans, d[x-1] + d[x] + d[x+1])

print(ans)
h,w=map(int,input().split())
l=[["."for i in range(w+2)],[".",input().split(),"."]for i in range(h),["."for i in range(w+2)]]
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if l[i][j]==".":
      continue
    if l[i+1][j]=="#" and l[i-1][j]=="#" and l[i][j+1]=="#" and l[i][j-1]=="#":
      continue
    ans=1
print("YNeos"[ans::2])

### FIXED CODE ###

h,w=map(int,input().split())
l=["."*(w+2)]
for i in range(h):
  l+=["."+input()+"."]
l+=["."*(w+2)]
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if l[i][j]==".":
      continue
    if l[i+1][j]=="#" or l[i-1][j]=="#" or l[i][j+1]=="#" or l[i][j-1]=="#":
      continue
    ans=1
print("YNeos"[ans::2])
N = int(input())
A = list(map(int, input().split()))
result = {}
count = []
count = [0 for i in range(N)]

for i in range(1, len(A)+2):
    for j in A:
        if(j == i):
            count[i-1] = count[i-1]+1
for i in range(i):
    print(count[i])


### FIXED CODE ###

import math
a = float(input())
print(2 * a * math.pi )
import sys
x = [int(i) for i in sys.stdin.readlines()]

for i, p in iteritems(x):
    if i == 0 and p == 0:
        break
    elif i < p:
        print(i p)
    elif i> p:
        print(p i)
    else:
        print(i p)

### FIXED CODE ###

import sys
   
while True:
    (x, y) = [int(i) for i in sys.stdin.readline().split(' ')]
   
    if x == 0 and y == 0:
        break
   
    if x > y:
        z = x
        x = y
        y = z
   
    print(x, y)
l, r = map(int, input().split())
m = []
if l == r:
  print(l%2019 * l%2019)
else:
  if r - l < 2019:
    for i in range(l, r+1):
      m.append(i%2019)
  else:
    for i in range(l, l+2020):
      m.append(i%2019)
  m = sorted(m)
  print(


### FIXED CODE ###

l, r = map(int, input().split())
m = []
if l == r:
  print(l%2019 * l%2019)
else:
  if r - l < 2019:
    for i in range(l, r+1):
      m.append(i%2019)
    ans = 2019
    for i in range(len(m)-1):
      for j in range(i+1, len(m)):
        temp = (m[i]*m[j])%2019
        if ans > temp:
          ans = temp
    print(ans)
  else:
    print(0)
a,b = map(int,input().split())
S = input()
tmp = S[0]
cnt = 0
L = []
for x in S:
    if tmp == x:
        cnt += 1
    else:
        L.append(cnt)
        cnt = 1
        tmp = x
L.append(cnt)
tmp = 0
for _ in range(b):
    for _ in range(2):
        tmp += L.pop(0)
tmp += L.pop(0)
L = [tmp] + L
print(sum(L) - len(L))


### FIXED CODE ###

a,b = map(int,input().split())
S = input()
tmp = S[0]
cnt = 0
L = []
for x in S:
    if tmp == x:
        cnt += 1
    else:
        L.append(cnt)
        cnt = 1
        tmp = x
L.append(cnt)
tmp = 0
for _ in range(b):
    for _ in range(2):
        try:
            tmp += L.pop(0)
        except:
            print(a- 1)
            quit()
try:
    tmp += L.pop(0)
except:
    print(a-1)
    quit()
L = [tmp] + L
print(sum(L) - len(L))
N , L= map(int,input().split())
lst = []
Str = ''
for i in range(N):
    lst.append(input())
lst.sort()
for j in range(N):
    Str += Slst[j]
print(Str)


### FIXED CODE ###

N,L=map(int, input().split())
S=[]
for i in range(N):
    S.append(input())
S.sort()
result=''
for j in range(N):
    result+=S[j]     
print(result)
a=input()
if ord(a)<ord('a'):
  print(A)
else:
  print(a)

### FIXED CODE ###

a=input()
if ord(a)<ord('a'):
  print('A')
else:
  print('a')
k = int(input())
n = 50
m = (n - 1) * (k + 1) + 1


series = str(m)
for i in range(n):
    series = series + " 0"

print(str(n))
print(series)


### FIXED CODE ###

x = input().split(" ")
n = int(x[0])
m = int(x[1])

probInit = set([])
probEnd  = set([])

for i in range(m):
    edge = input().split(" ")
    if edge[0] == "1":
        probInit.add(edge[1])

    if edge[1] == str(n):
        probEnd.add(edge[0])

sec = probEnd.intersection(probInit)
if (len(sec) == 0):
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
N, A, B = list(map(int,input().split()))
res = 0
for i in range(N+1):
  if A <= sum(int(s) for s in str(s)) <= B:
    res += i
print(res)

### FIXED CODE ###

N, A, B = list(map(int, input().split()))
print(sum(i for i in range(1,N+1) if A<=sum(map(int,str(i)))<=B))
admission = []
n = int(input())
admission.append(map(int,input().split()))

for i in range(n-):
    if admission[n-1] % 2 == 0:
        if admission[n-1] % 3 == 0 or admission[n-1] % 5 == 0:
            print("APPROVED")
        else:
            print("DENIED")

### FIXED CODE ###

n = int(input())
a = map(int,input().split())
for l in a:
    if l % 2 ==0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            quit()
print("APPROVED")
n = int(input())-1
a, b = 2, 1
if(n==0):
    print(2)
elif(n==1):
    print(1)
while(n):
    c = a + b
    a = b
    b = c
    n -= 1
print(c)

### FIXED CODE ###

n = int(input())
l = [2, 1]
for i in range(2, n+1):
    l.append(l[i-2]+l[i-1])
print(l[n])
A.upper(),B.upper(),C.upper() = input().split()
print(A[0]+B[0]+C[0])

### FIXED CODE ###

A,B,C = input().split()
print(A.upper()[0]+B.upper()[0]+C.upper()[0])