N = int(input('Введите N: '))
A = int(input('Введите A: '))
B = int(input('Введите B: '))
C = int(input('Введите C: '))
floors_A = abs(N - A)
floors_B = abs(N - B)
floors_C = abs(N - C)
if floors_A != floors_B and floors_B != floors_C and floors_C != floors_A:
min_floors = floors_A
elevator = 'A'
if floors_B < min_floors:
min_floors = floors_B
elevator = 'B'
if floors_C < min_floors:
min_floors = floors_C
elevator = 'C'
elif floors_A == floors_B or floors_A == floors_C:
if floors_A == floors_B:
if floors_A <= floors_C:
else:
if floors_A == floors_C:
if floors_A <= floors_B:
elif floors_B == floors_C:
if floors_B < floors_A:
if B > C:
N = int(input('Введите N: '))
A = int(input('Введите A: '))
B = int(input('Введите B: '))
C = int(input('Введите C: '))
floors_A = abs(N - A)
floors_B = abs(N - B)
floors_C = abs(N - C)
if floors_A != floors_B and floors_B != floors_C and floors_C != floors_A:
min_floors = floors_A
elevator = 'A'
if floors_B < min_floors:
min_floors = floors_B
elevator = 'B'
if floors_C < min_floors:
min_floors = floors_C
elevator = 'C'
elif floors_A == floors_B or floors_A == floors_C:
if floors_A == floors_B:
if floors_A <= floors_C:
elevator = 'A'
else:
elevator = 'C'
if floors_A == floors_C:
if floors_A <= floors_B:
elevator = 'A'
else:
elevator = 'B'
elif floors_B == floors_C:
if floors_B < floors_A:
if B > C:
elevator = 'B'
else:
elevator = 'C'
else:
elevator = 'A'
else:
elevator = 'A'