A = int(input('Введите A: '))
B = int(input('Введите B: '))
numbers = []
if A < B:
for num in range(B, A - 1, - 1):
if num % 5 == 0:
numbers.append(num)
if len(numbers) == 3:
break
else:
for num in range(A, B - 1, - 1):
print(f'{" ".join(str(num) for num in numbers)}')
A = int(input('Введите A: '))
B = int(input('Введите B: '))
numbers = []
if A < B:
for num in range(B, A - 1, - 1):
if num % 5 == 0:
numbers.append(num)
if len(numbers) == 3:
break
else:
for num in range(A, B - 1, - 1):
if num % 5 == 0:
numbers.append(num)
if len(numbers) == 3:
break
print(f'{" ".join(str(num) for num in numbers)}')