N = int(input())
divisions = []
for i in range(1, N // 2 + 2):
    if N % i == 0:
        divisions.append((i, N // i))
print(divisions)
results = []
for divs in divisions:
    results.append(abs(divs[0] - divs[1]))
print(min(results))

3b676e2a0d42459808502848ed1ebf452b062d78
<mask token>

<mask token>
for i in range(1, N // 2 + 2):
    if N % i == 0:
        divisions.append((i, N // i))
print(divisions)
<mask token>
for divs in divisions:
    results.append(abs(divs[0] - divs[1]))
print(min(results))

N = int(input())
divisions = []
for i in range(1, N // 2 + 2):
    if N % i == 0:
        divisions.append((i, N // i))
print(divisions)
results = []
for divs in divisions:
    results.append(abs(divs[0] - divs[1]))
print(min(results))
