Harryxun/stf_run huggingface dataset:
import sys


def g(inta, intb):
    d = abs(a - b)
    return g(d, a) if a % d != 0 else d


def lcm(inta, intb, intgcd):
    return inta * intb // intgcd


sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = g(a, b)
    print(c, lcm(a,b,c))

### FIXED CODE ###

import sys
 
def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)
 
sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c))
A. B = map(int, input().split())
if A + B >= 24:
  print((A + B) - 24)
else:
  print(A + B)

### FIXED CODE ###

A, B = map(int,input().split())
if A + B < 24:
  print(A + B)
else:
  print((A + B) - 24)
import math
K, A, B = map(int, input.split())
ans = K+1
if B > 2 + A:
  N = K - A
  if N == 1:
    ans = B
  elif N%2==1:
    ans=B+(B-A)*math.floor((K-A)/2)
  elif N%2==0:
    ans=B+(B-A)*math.floor((K-A)/2-1)+1

print(ans)

### FIXED CODE ###

import math
K, A, B = map(int, input().split())
ans = K+1
if B > 2 + A:
  N = K - A
  if N == 1:
    ans = B
  elif N%2==1:
    ans=B+(B-A)*math.floor((K-A)/2)
  elif N%2==0:
    ans=B+(B-A)*math.floor((K-A)/2-1)+1

print(ans)
# encoding: utf-8

import sys
from collections import deque


class Solution:
    @staticmethod
    def doubly_linked_list():
        # write your code here
        array_length = int(input())
        _input = sys.stdin.readlines()
        task_list = list(map(lambda x: dict(action=x.split()[0], value=int(x.split()[-1])), _input))
        task_deque = deque()
        for task in task_list:
            action = task.get('action')
            if action == 'insert':
                task_deque.appendleft(task.get('value'))
            elif action == 'deleteFirst':
                task_deque.popleft()
            elif action == 'deleteLast':
                task_deque.pop()
            else:
                task_deque.remove(task.get('value'))

        print(" ".join(map(str, task_deque)))
        assert len(task_deque) <= array_length


if __name__ == '__main__':
    solution = Solution()
    solution.doubly_linked_list()

### FIXED CODE ###

# encoding: utf-8

import sys
from collections import deque


class Solution:
    @staticmethod
    def doubly_linked_list():
        # write your code here
        array_length = int(input())
        task_deque = deque()
        _input = sys.stdin.readlines()

        for i in range(array_length):
            l_arg = _input[i].split()
            action = l_arg[0]
            if len(l_arg) > 1:
                value = l_arg[-1]
            # print(action, 'v', value)

            if action == 'insert':
                task_deque.appendleft(value)
            elif action == 'deleteFirst':
                task_deque.popleft()
            elif action == 'deleteLast':
                task_deque.pop()
            else:
                try:
                    task_deque.remove(value)
                except Exception as e:
                    pass
        print(" ".join(task_deque))


if __name__ == '__main__':
    solution = Solution()
    solution.doubly_linked_list()
N = int(input())

 def dfs(s): # 文字列 s で始まる七五三数の個数
 if int(s) > N:
 return 0
 ret = 1 if all(s.count(c) > 0 for c in '753') else 0 # s 自体が七五三数なら +1
 for c in '753':
 ret += dfs(s + c)
 return ret

 print(dfs('0'))

### FIXED CODE ###

N = int(input())
def shichi(n):
    if int(n) > N:
        return 0
    ret=1 if all(n.count(c)>0 for c in "753") else 0
    for c in "753":
        ret += shichi(n+c)
    return ret
print(shichi("0"))
inf = 10**15
mod = 10**9+7
x = int(input())
for i in range(-10**5, 10**5+1):
    tmp = i**5-x
    b = int(abs(tmp)**(1/5))
    if b**5 == abs(tmp):
        if tmp > 0:
            print('{} {}'.format(i, b))
        else:
            print('{} {}'.format(i, -b))
        sys.exit()

### FIXED CODE ###

import sys
inf = 10**15
mod = 10**9+7
x = int(input())
for i in range(-10**5, 10**5+1):
    tmp = i**5-x
    b = int(abs(tmp)**(1/5))
    if b**5 == abs(tmp):
        if tmp > 0:
            print('{} {}'.format(i, b))
        else:
            print('{} {}'.format(i, -b))
        sys.exit()
max_len = int(input())
str = input()
str_len = len(str)
if str_len <= max_len:
  print(str)
else:
  print(str[0:max_len] + "...")

### FIXED CODE ###

str = input()
a = str[-1:]
if a == "3":
	result = "bon"
elif (a == "0") or (a == "1") or (a == "6") or (a == "8"):
  	result = "pon"
elif (a == "2") or (a == "4") or (a == "5") or (a == "7") or (a == "9"):
  	result = "hon"
else:
  	result = "ng"
    
print(result)
N,X = map(int,input().split())
D = 0
ans = 1
for i in range(N):
    if D <=X:
        D+=int(input())
        ans+=1
    else:
        A =input()
        continue
if D >X:
    ans-=1
print(ans)

### FIXED CODE ###

N,X = map(int,input().split())
D = 0
ans = 1
L = list(x for x in input().split())
for i in range(N):
    
    if D <=X:
        D+=int(L[i])
        ans+=1
    else:
        continue
if D >X:
    ans-=1
print(ans)
s = input()
nl = len(s)

alp =["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"]
s_new = []

for i in range(nl):
    newnumber = alp.index(s[i])+n
    if newnumber > 25:
        newnumber = newnumber - 26
    newi = alp[newnumber]
    s_new.append(newi)

s_ans = ""
for i in range(nl):
    s_ans += s_new[i]
print(s_ans)

### FIXED CODE ###

n = int(input())
s = input()
nl = len(s)

alp =["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"]
s_ans = ""

for i in range(nl):
    newnumber = alp.index(s[i])+n
    if newnumber > 25:
        newnumber = newnumber - 26
    newi = alp[newnumber]
    s_ans += newi

print(s_ans)
check='abcdefghijklmnopqrstuvwxyz'
s=input()
l=len(s)
pos=[0]*26
for i in range(l):
  for j in range(26):
    if s[i]==check[j]:
      pos[j].append(i)
ans=10**9:
  for i in range(26):
    tmp=0
    for j in range(len(pos[i])-1):
      tmp=max(tmp,pos[i][j+1]-pos[i][j])
    tmp=max(tmp,(l-1)-pos[i][-1])
    ans=min(ans,tmp)
print(ans)

### FIXED CODE ###

check='abcdefghijklmnopqrstuvwxyz'
s=input()
l=len(s)
pos=[[0] for _ in range(26)]
for i in range(l):
  for j in range(26):
    if s[i]==check[j]:
      pos[j].append(i+1)
ans=10**9
for i in range(26):
  tmp=0
  for j in range(len(pos[i])-1):
    tmp=max(tmp,pos[i][j+1]-pos[i][j]-1)
  tmp=max(tmp,l-pos[i][-1])
  ans=min(ans,tmp)
print(ans)
a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_input())

def dfs(x, i, a, b , c):
  	if x < 0:
  		return 0
  	if x == 0:
  		return 1
  	
  	if i == 3:
  		return 1 if x == 0 else 0
  	r = 0
  	m = {0:a,1:b,2:c}
  	v = {0:500,1:100,2:50}

  	for k in range(1, m[i] + 1):
  		r += dfs(x - k * v[i], i+1, a,b,c)
  	return r

print f(x,0,a,b,c)


### FIXED CODE ###

a = int(raw_input())
b = int(raw_input())
c = int(raw_input())
x = int(raw_input())

def dfs(x, i, a, b , c):
  	if x < 0:
  		return 0
  	if x == 0:
  		return 1
  	
  	if i == 3:
  		return 1 if x == 0 else 0
  	r = 0
  	m = {0:a,1:b,2:c}
  	v = {0:500,1:100,2:50}

  	for k in range(0, m[i] + 1):
  		r += dfs(x - k * v[i], i+1, a,b,c)
  	return r

print dfs(x,0,a,b,c)
import copy
N, T = map(int, input().split())
ct = {}
for _ in range(N):
  ci, ti = map(int, input().split())
  ct[ci] = ti
  
count = 0
ct2 = copy.deepcopy(ct)
for ci, ti in ct.items():
  if ti > T:
    count += 1
    del ct2[ci]

if count == N:
  print("TLE")
  exit()

print(min(ct2.keys()))


### FIXED CODE ###

N, T = map(int, input().split())
c = []
for _ in range(N):
  ci, ti = map(int, input().split())
  if ti <= T:
      c.append(ci)

if len(c) == 0:
  print("TLE")
else:
  print(min(c))
#?????????
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)
 
 
def merge(A, left, mid, right):
    
    n1 = mid -left
    n2 = right - mid
    L = []
    R = []
    x = [" "," ", 10**10]
    for i in range(0, n1):
        L.append(A[left + i])
    for i in range(0, n2):
        R.append(A[mid + i])
    L.append(x)
    R.append(x)
    i = 0
    j = 0
    for k in range(left, right):
     
        if float(L[i]) <= float(R[j]):
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
            
            
def partition(A, p, r):
    x = float(A[r][2])
    i = p - 1
    for j in range(p, r):
        if float(A[j][2]) <= x:
            i = i + 1
            A[i],A[j]=A[j], A[i]
             
    A[i+1], A[r]=A[r], A[i+1]
    return i+1
 
def quicksort(A, p, r):
    if p < r:
        q = partition(A, p, r)
         
        quicksort(A, p, q-1)
        quicksort(A, q+1, r)
 
 
 
 
if __name__ == "__main__":
    num = int(raw_input())
    num_list = []
    num_list1 = []
    for i in range(num):
        num_list.append(raw_input())
    num_list1 = list(num_list)
    quicksort(num_list, 0, len(num_list)-1)
  
    mergesort(num_list1, 0, len(num_list1))
     
    if num_list == num_list1:
        print ("Stable")
    else:
        print ("Not stable")
    print "\n".join(num_list)

### FIXED CODE ###

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)
 
 
def merge(A, left, mid, right):

    n1 = mid -left
    n2 = right - mid
    L = []
    R = []
    x = "  10000000000"
    for i in range(0, n1):
        L.append(A[left + i])
    for i in range(0, n2):
        R.append(A[mid + i])
    L.append(x)
    R.append(x)
    i = 0
    j = 0
    for k in range(left, right):
        if int(L[i][2:]) <= int(R[j][2:]):
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
            
            
def partition(A, p, r):
    x = int(A[r-1][2:])
    i = p - 1
    for j in range(p, r-1):
        if int(A[j][2:]) <= x:
            i = i + 1
            A[i],A[j]=A[j], A[i]
             
    A[i+1], A[r-1]=A[r-1], A[i+1]
    return i+1
 
def quicksort(A, p, r):
    if p < r-1:
        q = partition(A, p, r)
         
        quicksort(A, p, q)
        quicksort(A, q+1, r)
 
 
 
 
if __name__ == "__main__":
    num = int(raw_input())
    num_list = []
    num_list1 = []
    for i in range(num):
        num_list.append(raw_input())
    num_list1 = list(num_list)
    quicksort(num_list, 0, len(num_list))
  
    mergesort(num_list1, 0, len(num_list1))
     
    if num_list == num_list1:
        print ("Stable")
    else:
        print ("Not stable")
    print "\n".join(num_list)
num = input()
num_list = []
num_list = num.split()

if int(num_list[0]) == int(num_list[1]):
    print('a',b,sep=' == ')
elif int(num_list[0]) > int(num_list[1]):
    print('a','b',sep=' > ')
else:
    print('a','b',sep=' < ')

### FIXED CODE ###

num = input()
num_list = []
num_list = num.split()

if int(num_list[0]) == int(num_list[1]):
    print('a','b',sep=' == ')
elif int(num_list[0]) > int(num_list[1]):
    print('a','b',sep=' > ')
else:
    print('a','b',sep=' < ')
for e in iter(input,'0'):
 a=list({tuple(map(int,input().split())) for _ in range(int(e))})
 s,t=a[0]
 b={list(map(int,input().split())) for _ in range(int(input()))}
 for x,y in b:
  flag = True
  for u,v in a[1:]:
   if [x + u - s, y + v - t] not in b:
    flag = False
    break
  if flag == True:
   print(x - s, y - t)
   break


### FIXED CODE ###

for e in iter(input,'0'):
 a=[[*map(int,input().split())]for _ in[0]*int(e)]
 s,t=min(a)
 b={tuple(map(int,input().split()))for _ in[0]*int(input())}
 m=max(b)[0]-max(a)[0]+s
 for x,y in b:
  if x<=m:
   for u,v in a:
    if(x+u-s,y+v-t)not in b:break
   else:print(x-s,y-t);break
a,b=map(int,input())
if a%3==0 or b%3==0 or (a+b)%3==0:
 print("Possible")
else:
 print("Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
 print("Possible")
else:
 print("Impossible")
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
a = [0] * n
for _ in range(m):
    x, y = map(int, input().split())
    a[x] = (a[x] + 1) & 1
    a[y] = (a[y] + 1) & 1
print("YES" if sum(a) == 0 else "NO")


### FIXED CODE ###

from collections import defaultdict
# d = defaultdict(int)で0で初期化
# d = defaultdict(lambda: 100)で100で初期化
import sys
sys.setrecursionlimit(10000000)
input = sys.stdin.readline
n, m = map(int, input().split())
es = [defaultdict(int) for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    es[a][b] += 1
    es[b][a] += 1
    if es[a][b] == 2:
        es[a].pop(b)
        es[b].pop(a)

def dfs(v, p, r):
    for i in es[v]:
        if i != p:
            es[i].pop(v)
            es[v].pop(i)
            if i == r:
                return - 1
            else:
                return dfs(i, v, r)
    return - 2

for i in range(n):
    if es[i]:
        if dfs(i, -1, i) == -2:
            print("NO")
            exit()
print("YES")
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = []
for i in range(2**d):
    tmp = 0
    cnt = 0
    gg = g 
    bag = []
    for j in range(d):
        if (i>>j)&1:
            # すべて解く
            tmp += 100*(j+1)*pc[j][0] + pc[j][1]
            cnt += pc[j][0]
            bag += [j]

    if tmp > gg:
        ans += [cnt]
    else:
        gg -= tmp 
        for j in range(d-1, -1, -1):
            if j not in bag:
                c = (gg-1)//(100*(j+1))+1
                if 0 <= c <= pc[j][0]:
                    gg -= 100*(j+1)*c + pc[j][1]
                    cnt += c 
                if gg <= 0:
                    ans += [cnt]
                    break
        
print(min(ans))


### FIXED CODE ###

import math
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
n = sum([pc[i][0] for i in range(d)])
prob = []
comp = [0 for _ in range(len(pc))]
for i in range(len(pc)):
    prob += [100*(i+1)] * (pc[i][0])
for i in range(len(pc)):
    comp[i] = pc[i][0]
ans = float('inf')

for i in range(2 ** d):
    score = 0
    num = 0
    max_num = 0
    for j in range(d):
        #print("score:", score, "num:", num, "j:", j, "i:", i)
        if (i>>j) & 1:
            score += 100*(j+1)*pc[j][0] + pc[j][1]
            num += pc[j][0]
            
        else:
            max_num = max(max_num, j+1)
            #if max_num == j+1:
                #max_num -= 1 
    if score < g:
        add_n = math.ceil((g-score)/(100*(max_num)))
        #if i == 24:
            #print(num, add_n, score, max_num)
        #print("add_n:", add_n, max_num)
        if add_n < pc[max_num-1][0]:
            num += add_n
            score += add_n * (100*(max_num+1))

    #print(score, num)
    if score >= g:
        ans = min(ans, num)
        #print(num,i)

print(ans)
import numpy as np

n = int(input())

table = np.zeros(100)

for i in range(1, 10):
    for j in range(1, 10):
        table[i * j] = 1

if table[n] == 1:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

n = int(input())

table = [0 for i in range(0, 102)]

for i in range(1, 10):
    for j in range(1, 10):
        table[i * j] = 1

if table[n] == 1:
    print('Yes')
else:
    print('No')
X = int(input())
for i in range(X+1, 9999999999999999):
    flag = 1
    for j in range(2, X//2 +1):
        if i % j == 0:
            flag = -1
            break
    # if X == 2:
    #     print(2)
    #     break
    # elif X == 3:
    #     print(3)
    #     break
    elif flag == 1:
        print(i)
        break

### FIXED CODE ###

X = int(input())
for i in range(X, 9999999999999999):
    flag = 1
    for j in range(2, X//2 +1):
        if i % j == 0:
            flag = -1
            break
    if X == 2:
        print(2)
        break
    elif X == 3:
        print(3)
        break
    elif flag == 1:
        print(i)
        break
a, b, c d = map(int, input().split())
aa=a
cc=c
for i in range(a//d+1):
    cc = cc - b
    print(cc)
    if cc<1:
      print("Yes")
      break;
    aa = aa - d
    print(aa)
    if aa <1:
      print("No")
      break;

### FIXED CODE ###

a, b, c,d = map(int, input().split())
aa=a
cc=c
for i in range(a//d+1):
    cc = cc - b

    if cc<1:
      print("Yes")
      break;
    aa = aa - d

    if aa <1:
      print("No")
      break;
a, b, c ,d = map(int, input().split())
attack = True
win = True

while True:
	if attack:
		c -= b
		attack = False
		if c < 0:
			break
	else:
		a -= d
		attack = True
		if a < 0:
			win = False 
			break


print("Yes") if win else print('No')


### FIXED CODE ###

s, w = map(int, input().split())

print("unsafe") if (s <= w) else print("safe")
ans = [int(input()) for _ range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')

### FIXED CODE ###

ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')
n = int(input())
a = list(map(int,input().split()))
b = list(map(abs,a))
c = list(a for a in A if a < 0)

if len(c) % 2 == 0:
    print(sum(b))
else:
    print(sum(b)-min(b)*2)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(abs, A))
C = [a for a in A if a < 0]
if len(C) % 2 == 0:
    print((sum(B)))
else:
    print((sum(B) - min(B)*2))
l = float(intput())
e = l / 3.0
print(e*e*e)

### FIXED CODE ###

l = int(input())
e = l / 3
print(e*e*e)
ef rev (s):
    _re=''.join(list(reversed(s)))
    return _re

name = ['dream','dreamer','eraser','erase']
S = input()
S_re = rev(S)
can = False
can2 = False
for i in range(len(S_re)):
    for div in name:
        if S_re[i:i+len(div)]==rev(div) :
            i+=len(div)
            can = True
        if can :
            can2 = True
            break
    if not can2 :
        break
if can2 :
    print('YES')
else :
    print('No')


### FIXED CODE ###

import re
print("YES" if re.match("^(dream|dreamer|erase|eraser)+$",input()) else "NO")
import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
for N in range(n):
    b = a.copy()
    b.remove(b[N])
    gcds = max(gcds,reduce(fractions.gcd, b))
print(max(gcds))

### FIXED CODE ###


import fractions
from functools import reduce
n = int(input())
a = list(map(int,input().split()))
gcds = 0
r = [0]
l = [0]
for N in range(n):
	r.append(fractions.gcd(r[N],a[N]))
	l.append(fractions.gcd(l[N],a[n - N - 1]))
for i in range(n):
	gcds = max(gcds,(fractions.gcd(r[i],l[n - i - 1])))
print(gcds)
n = int(input())
T=[int(input()) for i in range(n)]
T = sorted(T,reverse=True)

for i in range(2,100):
  if T[0] % T[1] !=0:
    T[0] = T[0]*i
  else:
    print(T[0])
    exit()

### FIXED CODE ###

n = int(input())
T=[int(input()) for i in range(n)]


def euclid(a,b):
  r = a % b
  return euclid(b,r) if r else b

def lcm(a,b):
  return a * b //euclid(a,b)

num = T[0]
for i in range(1,n):
  num = lcm(num, T[i])
print(num)
n, time = map(int, input().split())

arr = list(map(int, input().split())) + [float("inf")]

left, temp, sum_time = 0, 0, 0

for t in arr[1:]:
  if t <= left + time:
    temp = t
  else:
    sum_time += (temp + time - left)
    left, temp = t

print(sum_time)


### FIXED CODE ###

n, time = map(int, input().split())
 
arr = list(map(int, input().split())) + [float("inf")]
 
left, temp, sum_time = 0, 0, 0
 
for t in arr[1:]:
  if t <= temp + time:
    temp = t
  else:
    sum_time += (temp + time - left)
    left, temp = t, t
 
print(sum_time)
a,b,c= map(int, input().split())
d=(b/a)
if d=> c:
  print(c)
else:
  print(d)

### FIXED CODE ###

a,b,c= map(int, input().split())
d=int(b/a)
if d>= c:
  print(c)
else:
  print(d)
import fractions
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=abs(x-a[0])
cnt=abs(a[1]-a[0])
for j in range(n-1):
    cnt=min(abs(a[j+1]-a[j]),cnt)
for i in range(n):
    ans=min(abs(x-a[i]),ans)
print(min(ans,cnt))
    

### FIXED CODE ###

n=int(input())
w=[]
ans='Yes'
for i in range(n):
    w.append(list(input()))
    if i==0:
        continue
    if w[i][0]!=w[i-1][len(w[i-1])-1]:
            ans='No'
            break
    for j in range(i):
        if w[i]==w[j]:
            ans='No'
            break
print(ans)
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+3)]
i=1
while i<=N+1:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+2)]
i=1
while i<=N:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1
else:
    print(i)
import collections 
N,X,Y = map(int,input().split())
d = [[0]*(N+1) for _ in range(N+1)]
for i in range(1,N):#i => j
    for j in range(i+1,N+1):
        if(i>=Y or j<=X):
            d[i][j] = j-i
        elif(i<=X and j>=Y):
            d[i][j] = (X-i)+1+(j-Y)
        else:
            a_path = j-i
            b_path = abs(X-i)+1+abs(Y-j)
            d[i][j] = min(a_path,b_path)

ans = [0]
for i in range(N+1):
    ans += d[i]
c = Counter(ans)
for k in range(1,N): 
    print(c[k])

### FIXED CODE ###

import collections 
N,X,Y = map(int,input().split())
d = [[0]*(N+1) for _ in range(N+1)]
for i in range(1,N):#i => j
    for j in range(i+1,N+1):
        if(i>=Y or j<=X):
            d[i][j] = j-i
        elif(i<=X and j>=Y):
            d[i][j] = (X-i)+1+(j-Y)
        else:
            a_path = j-i
            b_path = abs(X-i)+1+abs(Y-j)
            d[i][j] = min(a_path,b_path)

ans = [0]
for i in range(N+1):
    ans += d[i]
c = collections.Counter(ans)
for k in range(1,N): 
    print(c[k])
def lsum(x):
    return A[x[0]] + B[x[1]] + C[x[2]]

def nextlist():
    global lx
    idx = 0
    m = lsum(lx[0])
    for i in range(len(lx)):
        s = lsum(lx[i])
        if m < s:
            m = s
            idx = i
    p = lx.pop(idx)
    wa.append(lsum(p))
    if p[0] > 0:
        if not [p[0]-1, p[1], p[2]] in lx:
            lx.append([p[0]-1, p[1], p[2]])
    if p[1] > 0:
        if not [p[0], p[1]-1, p[2]] in lx:
            lx.append([p[0], p[1]-1, p[2]])
    if p[2] > 0:
        if not [p[0], p[1], p[2]-1] in lx:
            lx.append([p[0], p[1], p[2]-1])

l1 = list(map(int, input().split(" ")))

X,Y,Z,K = l1[0],l1[1],l1[2],l1[3]
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted(list(map(int, input().split(" "))))

wa = []
lx = [[X-1,Y-1,Z-1]]

for i in range(K):
    nextlist()

for l in wa:
    print(l)


### FIXED CODE ###

a=[]
for i in range(5):
    a.append(int(input()))
k = int(input())
for i in range(5):
    for j in range(i+1,5):
        if abs(a[i]-a[j]) > k:
            print(":(")
            exit()
print("Yay!")
H,W = [int(i) for i in input().split()]
li = ['0'] * H
for i in range(H) :
    li[i] = list(input())
dx = [1,0,-1,0]
dy = [0,1,0,-1]
counta = 0
count = 0
for i in range(H) :
    for j in range(W) :
        if li[i][j] == "#" :
            counta+=1
for i in range(H) :
    for j in range(W) :
        if li[i][j] == "#" :
            for k in range(4) :
                nx = i + dx[k]
                ny = j + dy[k]
                if nx < 0 or nx > W-1 or ny < 0 or ny > H-1 :
                    continue
                if li[nx][ny] == "#" :
                    count+=1
                    break
if count == counta:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

h, w = list(map(int, input().split()))
graph = []
def check(s,t):
    if (0 <=  s <= w - 1) and (0 <= t <= h - 1):
        return True
    else:
        return False
def check_around(x,y):
    if check(x+1,y) and graph[y][x+1] == '#':
        return True
    if check(x,y+1) and graph[y+1][x] == '#':
        return True
    if check(x-1,y) and graph[y][x-1] == '#':
        return True
    if check(x,y-1) and graph[y-1][x] == '#':
        return True
    return False
for i in range(h):
    graph.append(list(input()))
for i in range(h):
    for j in range(w):
        if graph[i][j] == '#':
            if  not check_around(j,i):
                print("No")
                exit()
print("Yes")