import heapq

n = int(input())
xy_ls = [tuple(map(int, input().split())) for i in range(n)]

def sq_dist(xy1, xy2):
    x1, y1 = xy1
    x2, y2 = xy2
    return (x2 - x1)**2 + (y2 - y1)**2

sq_dist_ls = []
for i in range(n - 1):
    xy1 = xy_ls[i]
    for j in range(i + 1, n):
        xy2 = xy_ls[j]
        heapq.heappush(sq_dist_ls, (sq_dist(xy1, xy2), i, j))

def p_find(memo, p):
    if memo[p] < 0:
        return p
    memo[p] = p_find(memo, memo[p])
    return memo[p]

def p_union(memo, p1, p2):
    p1_root = p_find(memo, p1)
    p2_root = p_find(memo, p2)
    if p1_root != p2_root:
        memo[p1_root] = p2_root

def get_ans(sq_x):
    x = int(sq_x**0.5 // 10 * 10)
    return x + 10 if x**2 < sq_x else x

start = 0
goal = n - 1

memo = [-1] * n
while len(sq_dist_ls) > 0:
    sq_dist, p1, p2 = heapq.heappop(sq_dist_ls)
    p_union(memo, p1, p2)
    if p_find(memo, start) == p_find(memo, goal):
        break

ans = get_ans(sq_dist)
print(ans)