Harryxun/stf_run huggingface dataset:
#import sys

#input = sys.stdin.readline

#import heapq
import math

def main():
#    h,w,a,b = map(int, input().split())
    a,b=map(int,input().split())
    m=2
    k=1
    c=math.sqrt(max(a,b))
    count=1
    sosu=[2,3]
    for i in range(len(sosu)):
        if a%sosu[i]==0 and b%sosu[i]==0:
            count+=1
            a//=sosu[i]
            b//=sosu[i]
        elif a%sosu[i]==0:
            a//=sosu[i]
        elif b%sosu[i]==0:
            b//=sosu[i]


    c = math.sqrt(max(a, b))
    while m < c:
        m = 6 * k +1
        if a % m == 0 and b % m == 0:
            count += 1
            while true:
                a//=m
                b//=m
                if a%m==0 and b%m==0:
                    continue
                else:
                    break
            c=math.sqrt(max(a,b))
        elif a%m==0:
            a//=m
            c=math.sqrt(max(a,b))
        elif b%m==0:
            b//=m
            c=math.sqrt(max(a,b))
 #           print(count)
        k += 1

    k = 1
    m = 2
    while m < c:
        m = 6 * k -1
        if a % m == 0 and b % m == 0:
            count += 1
            while true:
                a //= m
                b //= m
                if a % m == 0 and b % m == 0:
                    continue
                else:
                    break
            c=math.sqrt(max(a,b))
        elif a%m==0:
            a//=m
            c=math.sqrt(max(a,b))
        elif b%m==0:
            b//=m
            c=math.sqrt(max(a,b))
        k += 1

    print(count)
#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()

### FIXED CODE ###

#import sys

#input = sys.stdin.readline

#import heapq
import math
import fractions

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True

def main():
#    h,w,a,b = map(int, input().split())
    a,b=map(int,input().split())
    m=4
    k=1

    count=1
    if a>b:
        a,b=b,a
    sosu=set()
    a = fractions.gcd(a,b)
    if a%2==0:
        sosu.add(2)
        while a%2==0:
            a//=2
    if a%3==0:
        sosu.add(3)
        while a%3==0:
            a//=3
#    print(d)
    c=math.sqrt(a)+1
 #   print(c)
    while m<=c and m!=1:
        if a%m==0:
            sosu.add(m)
            while a%m==0:
                a//=m

        m+=1
#    print(sosu)
    if sosu==set() and a!=1:
        sosu.add(a)
    if sosuhante(a) and a!=1:
        sosu.add(a)
#    print(sosu)
    count+=len(sosu)
    print(count)
#    for i in range(h):
#            print(aaa)

if __name__ == "__main__":
    main()
S = input()
if S == 'ABC':
  print('ARC')
elif S == 'ARC'):
  print('ARC')

### FIXED CODE ###

S = input()

if S == 'ARC':
  print('ABC')
elif S == 'ABC':
  print('ARC')
N = int(input())
S = [input() for i in range(N)]

from collections import defaultdict
def decode(s):
  d = defaultdict(int)
  for c in list(sorted(s)):
    d[c] += 1
  return d

decodes = [decode(s) for s in S]

hash_table = defaultdict(int)
for decode in decodes:
  hash_table[tuple(decode.items())] += 1
print(hash_table)
import math
c_list = [int(math.factorial(v)/math.factorial(2)) for v in hash_table.values()]
#print(c_list)
count = sum(c_list)

print(count)

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]
d = {}
S_trans = [''.join(sorted(list(s))) for s in S]
count = 0
for s in S_trans:
  if s in d:
    count += d[s]
    d[s] += 1
  else:
    d[s] = 1
print(count)
n=int(input())
s=set()
for i in range(n):
    s^=int(input())
print(s)

### FIXED CODE ###

n=int(input())
s=set()
for i in range(n):
    s ^= {input()}
print(len(s))
a=input()
b=input()
c=a.split()
n=int(c[0])
d=b.split()
d=[int(i) for i in d]
d.sort(reverse=True)
count=0
ll=list()
for i in d:
    if count!=0:
        ll.append(c-i)
    c=i
    count+=1
ll.sort()
for i in range(n-1):
    ccc=len(ll)
    if ccc>=1
        del ll[-1]
print(sum(ll))


### FIXED CODE ###

a=input()
b=input()
c=a.split()
n=int(c[0])
d=b.split()
d=[int(i) for i in d]
d.sort(reverse=True)
count=0
ll=list()
for i in d:
    if count!=0:
        ll.append(c-i)
    c=i
    count+=1
ll.sort()
for i in range(n-1):
    ccc=len(ll)
    if ccc>=1:
        del ll[-1]
print(sum(ll))
import itertools
x = int(input())
digits = len(str(x))
dic = {}
keta = []
for i in range(10000):
    num = i ** 5    
    if (num > (10**9)) or (num > 10**(digits+1)):
        break
    if num > 10**(digits-2):
        dic[i] = num
    elif num < 10**(digits+1):
        dic[i] = num
        
for num1,num2 in itertools.combinations(dic.keys(), 2):
    a, b = dic[num1], dic[num2]
    if x == (a+b):
        ans = (num1,num2)
        break
    if x == (a-b):
        ans = (num1,-num2)
        break
    if x == (-a+b):
        ans = (-num1,num2)
        break
    if x == (-a-b):
        ans = (-num1,-num2)
        break
print(f"{ans[0]} {ans[1]}")

### FIXED CODE ###

import itertools
x = int(input())
digits = len(str(x))
dic = {}
keta = []
for i in range(121):
    num = i ** 5    
    if (num > 10**(digits+2)):
        break
    if num > 10**(digits-2):
        dic[i] = num
        dic[-i] = -num
    elif num < 10**(digits+1):
        dic[i] = num
        dic[-i] = -num
        
for num1,num2 in itertools.combinations(dic.keys(), 2):
    a, b = dic[num1], dic[num2]
    if x == (a-b):
        ans = (num1,num2)
        break
    if x == (-a+b):
        ans = (num2,num1)
        break
print(f"{ans[0]} {ans[1]}")
A = int(input())
B = int(input())

print(A*B-A-B+1)


### FIXED CODE ###


A, B = map(int, input().split())

print(A*B-A-B+1)
import sys
input=sys.stdin.readline
s=input()
len_s=len(s)
mod=10**9+7
dp=[[0]*13 for i in range(len_s)]

if s[-1]!='?':
    dp[0][int(s[-1])%13]=1
else:
    for i in range(10):
        dp[0][i]=1

a=1
for i in range(1,len_s):
    a=10*a%13
    if s[-(i+1)]!='?':
        temp_S=int(s[-(i+1)])
        amari=(temp_S*a)%13
        for j in range(13):
            dp[i][(amari+j)%13]+=dp[i-1][j]%mod

    else:
        for k in range(10):
            amari=(k*a)%13
            for l in range(13):
                dp[i][(amari+l)%13]+=dp[i-1][l]%mod
#print(*dp,sep='\n')
print(dp[-1][5]%mod)


### FIXED CODE ###

s=input()
len_s=len(s)
mod=10**9+7
dp=[[0]*13 for i in range(len_s)]

if s[-1]!='?':
    dp[0][int(s[-1])%13]=1
else:
    for i in range(10):
        dp[0][i]=1

a=1
for i in range(1,len_s):
    a=10*a%13
    if s[-(i+1)]!='?':
        temp_S=int(s[-(i+1)])
        amari=(temp_S*a)%13
        for j in range(13):
            dp[i][(amari+j)%13]+=dp[i-1][j]%mod

    else:
        for k in range(10):
            amari=(k*a)%13
            for l in range(13):
                dp[i][(amari+l)%13]+=dp[i-1][l]%mod
#print(*dp,sep='\n')
print(dp[-1][5]%mod)
a = input()
cnt = 0
while 1:
    c = input().lower()
    if c == end_of_text:
        break
    cnt = c.split().count(a)
print(cnt)


### FIXED CODE ###

a = input().lower()
cnt = 0
while 1:
    c = input()
    if c == 'END_OF_TEXT':
        break
    cnt += c.lower().split().count(a)
print(cnt)
# disjoint setかと思いきやDFS
n = int(input())
graph = [[] for _ in range(n)]

for _ in range(n - 1):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    graph[a].append([b, c])
    graph[b].append([a, c])

q, k = map(int, input().split())
k = k - 1
# kからスタートしてぜんぶたどる
ans_list = [0 for _ in range(n)]


def dfs(node, used, weight):
    for data in graph[node]:
        if data[0] not in used:
            next_used = used[:]
            next_used.append(data[0])
            dfs(data[0], next_used, weight + data[1])
    ans_list[node] = weight


dfs(k, [k], 0)

for _ in range(q):
    a, b = map(lambda x: int(x) - 1, input().split())
    print(ans_list[a] + ans_list[b])


### FIXED CODE ###

# disjoint setかと思いきやDFS
# したらTLEになったので根本的にやり方が間違ってるということ
# よくよく考えたらdfsなのでそこにたどり着いたときが最短距離だわ ムダに探索してた


import sys

sys.setrecursionlimit(10000000)

n = int(input())
graph = [[] for _ in range(n)]

for _ in range(n - 1):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    graph[a].append([b, c])
    graph[b].append([a, c])

q, k = map(int, input().split())
k = k - 1
# kからスタートしてぜんぶたどる
ans_list = [0 for _ in range(n)]


def dfs(node, weight):
    for data in graph[node]:
        if not used[data[0]]:
            used[data[0]] = True
            dfs(data[0], weight + data[1])
    ans_list[node] = weight


used = [False for _ in range(n)]
used[k] = True
dfs(k, 0)

for _ in range(q):
    a, b = map(lambda x: int(x) - 1, input().split())
    print(ans_list[a] + ans_list[b])
# -*- coding: utf-8 -*-
n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
count=0
l=0
while l<=x:
    l=l+L[count]
    count=count+1
print(count)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n,x=map(int,input().split())
L=input().split()
L=[int(i) for i in L]
count=0
l=0
while l<=x:
    if count>n-1:
        count=count+1
        break
    else:
        l=l+L[count]
        count=count+1
print(count)
# coding: utf-8
# Your code here!
import collections

N, M = map(int, input().split())
cities = [list(map(int, input().split())) for i in range(M)]
cities = sum(cities, [])

c_list = sorted(collections.Counter(cities).items())

for i in range(N):
    print(c_list[i][1])


### FIXED CODE ###

# coding: utf-8
# Your code here!

N, M = map(int, input().split())
arr = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    arr[A - 1] += 1
    arr[B - 1] += 1
  
for j in arr:
    print (j)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
trees[2].set_rank(2, None)

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
try:
    trees[1].set_rank(1, None)
except:
    print(-1)
    exit()

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))
def calc_Stairs_Patterns(num):
    if num >= 2:
        return calc_Stairs_Patterns(num - 1) + calc_Stairs_Patterns(num - 2)
    elif num == -1:
        print(0)
        exit()
    else:
        return 1
N, M = map(int,input().split())
data = []
for i in range(M):
    data.append(int(input()))
ans = 1
stair = 0
for i in data:
    ans *= calc_Stairs_Patterns(i  - 1 - stair)
    stair = i + 1
ans *= calc_Stairs_Patterns(N - stair)
print(ans % 1000000007)

### FIXED CODE ###

N, M = map(int,input().split())
data = []
dp = ['.' for i in range(N + 1)]
dp[0] = 1
dp[1] = 1
for i in range(M):
    k = int(input())
    data.append(k)
    dp[k] = 0
mod = 10**9 + 7
for i in range(2,N + 1):
    if dp[i] != 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print(dp[N] % mod)
import sys
from itertools import permutations

def main():
	while True:
		n = input()
		k = input()
		if n == k == 0:
			return 0
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())

### FIXED CODE ###

import sys
from itertools import permutations
 
def main():
	while True:
		line = raw_input()
		if line == "0 0": break
		n = int(line)
		k = input()
		nums = [raw_input().strip() for i in xrange(n)]
		result = set(["".join(p) for p in permutations(nums, k)])
		print (len(result))

if __name__ == '__main__':
	sys.exit(main())
A, B, C = (int(i) for i in input().split())

if((A<C) and (C<B)):
    print("Yes")
elif((B<C) and (C<A)):
    print("Yes")
else:
    print("No")
A, B, C = (int(i) for i in input().split())

if((A<C) and (C<B)):
    print("Yes")
elif((B<C) and (C<A)):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

A, B, C = (int(i) for i in input().split())
 
if((A<C) and (C<B)):
    print("Yes")
elif((B<C) and (C<A)):
    print("Yes")
else:
    print("No")
a, b = map(int, input().split())
if(a <= 10):
    b = 100 * (10 - a) + b
# 出力
print("{}".form

### FIXED CODE ###

a, b = map(int, input().split())
if(a <= 10):
    b = 100 * (10 - a) + b
# 出力
print("{}".format(b))
import sys
sys.setrecursionlimit(10**6)

n,m = map(int,input().split())
P = list(map(int,input().split()))
R = [list(map(int,input().split())) for i in range(m)]
U = [-1]*n
def root(x):
    if x == U[x-1]:
        return x
    elif U[x-1] == -1:
        return x
    return root(U[x-1])
for r in R:
    if U[r[0]-1]==-1:
        if U[r[1]-1]==-1:
            U[r[0]-1] = r[0]
            U[r[1]-1] = r[0]
        else:
            U[r[0]-1] = U[r[1]-1]
    else:
        if U[r[1]-1]==-1:
            U[r[1]-1] = U[r[0]-1]
        else:
            U[root(r[1])-1] = U[r[0]-1]
count = 0
for i in range(n):
    if root(P[i]) == root(i+1) and U[i] != -1:
        count += 1
    elif U[i] == -1 and P[i]-1 == i:
        count += 1
print(count)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

n,m = map(int,input().split())
Permutation = list(map(int,input().split()))
Replace = [list(map(int,input().split())) for i in range(m)]

uf = UnionFind(n+1)
count = 0

for i in range(m):
    uf.union(Replace[i][0],Replace[i][1])

for i in range(1,n+1):
    if uf.same(Permutation[i-1],i):
        count += 1

print(count)
import sys
input = sys.stdin.readline


N = int(input())
start = []
end = []
itv = []
for i in range(N):
    X, L = (int(i) for i in input().split())
    itv.append([X+L, X-L])
    #start.append(X-L)
    #end.append(X+L)

#XL = [[int(i) for i in input().split()] for i in range(N)] 

count = N
#line = [0] * (2*(10**9) +1)
XL = sorted(XL)


itv.sort()

ass = 0
tt = 0
for i in range(N):
    if tt < itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)


### FIXED CODE ###

import sys
input = sys.stdin.readline


N = int(input())
start = []
end = []
itv = []
for i in range(N):
    X, L = (int(i) for i in input().split())
    itv.append([X+L, X-L])
    #start.append(X-L)
    #end.append(X+L)

#XL = [[int(i) for i in input().split()] for i in range(N)] 

#line = [0] * (2*(10**9) +1)

itv.sort()

#print(itv)

ass = 0
tt = 0-10**9
for i in range(N):
    if tt <= itv[i][1]:
        ass += 1
        tt = itv[i][0]
print(ass)
N = int(input())
for _ in range(0, N) :
x1,y1,x2,y2,x3,y3,x4,y4 = list(map(int, input().split()))
  if ((y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3)) :
    print("YES")
  else :
    print("NO")

### FIXED CODE ###

N = int(input())
for i in range(0, N) :
  x1,y1,x2,y2,x3,y3,x4,y4 = list(map(float, input().split()))
  s = x2 - x1
  t = y2 - y1
  u = x4 - x3
  v = y4 - y3;
  if (abs(s * v - t * u) < 1e-10) :
    print("YES")
  else :
    print("NO")
# A
N = int(input())
a = list(map(int, input().split()))
flag = True
if N % 3  != 0:
    if max(a) == 0:
        print('Yes')
    else:
        print('No')
else:
    if N == 3:
        if a[0] == a[1] ^ a[2] and a[1] == a[2] ^ a[0] and a[2] == a[0] ^ a[1]:
            print('Yes')
        else:
            print('No')
    else:
        n = int(N / 3)
        a = sorted(a)
        for i in range(n):
            tmp_list = a[n * i : n*(i + 1)]
            if min(tmp_list) == max(tmp_list):
                pass
            else:
                flag = False
        if flag:
            print('Yes')
        else:
            print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
flag = True
if max(a) == 0:   # 全て0の時は必ず成り立つ
    flag = True
else:
    if N % 3 != 0:   # 全て0でなくて，Nが3の倍数出ない時は成り立たない
        flag = False
    else:
        n = N // 3
        a_set = set(a)
        if len(a_set) == 2:
            count = [] 
            value = []
            for number in a_set:
                count.append(a.count(number))
                value.append(number)
            if value[0] == 0 and count[0] == n and count[1] == n * 2:
                flag = True
            else:
                flag = False
        elif len(a_set) == 3:
            count = []
            value = []
            for number in a_set:
                count.append(a.count(number))
                value.append(number)
            if count[0] == count[1] == count[2]:
                if value[0] ^ value[1] ^ value[2] == 0:
                    flag = True
                else:
                    flag = False
            else:
                flag = False
        else:
            flag = False
if flag:
    print('Yes')
else:
    print('No')
rom collections import Counter
N=int(input())
A=list(map(int, input().split()))
 
count = Counter(A)
vals = count.values()
sum_ = 0
for v in vals:
  if v >= 2: sum_ += v*(v-1)
sum_ //= 2
 
for k in range(N):
  if count[A[k]] < 2: print(sum_)
  else:print(sum_ + 1 - count[A[k]])

### FIXED CODE ###

import numpy as np
n = int(input())
a = list(map(int,input().split()))
s = np.zeros(n+1)
for i in a:
    s[i]+=1
al = sum((s*(s-1))/2)
for i in range(n):
    ans=al-(s[a[i]]-1)
    print(int(ans))
h,w = map(int,input().split())
map_ = list()
for i in range(h):
    map_.append(list(input()))
flag = True
while flag:

    flag = False

    for ii in range(len(map_)):
        if set(map_[ii]) == {"."}:
            del map_[ii]
            flag = True
            break

    map_t = [list(x) for x in zip(*map_)]

    for ii in range(len(map_t)):
        if set(map_t[ii]) == {"."}:
            del map_t[ii]
            flag = True
            break

    map_ = [list(x) for x in zip(*map_t)]


for iiii in map_:
    print(*iiii,sep="")

### FIXED CODE ###

n,i = (int(x) for x in input().split())
print(n - i + 1 )
(H-h) * (W-w)

### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))
lst = map(int, raw_input().split())

print(max(lst)-min(lst

### FIXED CODE ###

lst = map(int, raw_input().split())


print(max(lst)-min(lst))
n,k=map(int,input().split())
s=input()
s[k]=lower(s[k])

### FIXED CODE ###

n,k=map(int,input().split())
s=input()
s=s[:k-1]+s[k-1].lower()+s[k:]
print(s)
n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np
npnums = np.array(nums)

cnt = 0 #個数のカウント

test = np.zeros(n*n).reshape(n,n)
for i,v in enumerate(nums):
    test[i] +=v

mask = (test % npnums ==0)

for i in mask:
    if np.count_nonzero(i) >1:
        cnt+=1

print(n-cnt)

### FIXED CODE ###

n = int(input())
nums = [int(e) for e in input().split()]
import numpy as np

ans= np.zeros(max(nums)+1)

for i in nums:
    if ans[i] >1:
        continue
    else:
        ans[i::i] +=1

cnt = 0
for i in nums:
    if ans[i] ==1:
        cnt +=1

print(cnt)
N,K=list(map(int,input().split()))
S = list(input())
S[K]=S[K].lower()
print("".join(S))


### FIXED CODE ###

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

for i in range(len(S)):
    if i != K-1:
        print(S[i],end='')
    else:
        print(chr(ord(S[i])+32),end="")
while True
 x,y =map(int,raw_input().split())
 if(x==0 and y==0):
  Break
 elif(x>y)
  print x>y

### FIXED CODE ###

while True:
 x,y =map(int, raw_input().split())
 if(x==0 and y==0):
   break
 elif(x>y):
  print y,x  
 elif(x<=y):
  print x,y
a,b,k=map(int,input().split())
if a+b<=k:
  print("0 0")
elif a>=k:
  print((a-k)+" "+b)
else print(0+" "+(a+b-k))

### FIXED CODE ###

a,b,k=map(int,input().split())
if a+b<=k:
  print(0,0)
elif a>=k:
  print(a-k,b)
else :print(0,a+b-k)
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
def gcd(a,b):
  c = a%b
  if c == 1:
    return b
  else:
    return gcd(b,c)
c = 0
for i in a[1:]:
  c_ = gcd(i,a[0])
  if c_ == 1:
    c = 1
    break
  else:
    if c_ < c:
      c = c_
print(c)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
def gcd(a,b):
  c = a%b
  if c == 0:
    return b
  else:
    return gcd(b,c)
c = 0
for i in a[1:]:
  c_ = gcd(i,a[0])
  if c_ == 1:
    c = 1
    break
  else:
    if c_ < c or c == 0:
      c = c_
print(c)