import math class UnionFind: def __init__(self, size): self.parent = list(range(size)) def find(self, x): while self.parent[x] != x: self.parent[x] = self.parent[self.parent[x]] # Path compression x = self.parent[x] return x def union(self, x, y): x_root = self.find(x) y_root = self.find(y) if x_root == y_root: return self.parent[y_root] = x_root def connected(self, x, y): return self.find(x) == self.find(y) n = int(input()) points = [] for _ in range(n): x, y = map(int, input().split()) points.append((x, y)) if n == 0: print(0) exit() s = 0 t = n - 1 edges = [] max_sq = 0 for i in range(n): x1, y1 = points[i] for j in range(i + 1, n): x2, y2 = points[j] dx = x1 - x2 dy = y1 - y2 sq = dx * dx + dy * dy if sq > max_sq: max_sq = sq edges.append((i, j, sq)) left = 0 right = max_sq answer_sq = max_sq while left <= right: mid_sq = (left + right) // 2 uf = UnionFind(n) for i, j, sq in edges: if sq <= mid_sq: uf.union(i, j) if uf.connected(s, t): answer_sq = mid_sq right = mid_sq - 1 else: left = mid_sq + 1 d = math.sqrt(answer_sq) L = math.ceil(d / 10) * 10 print(int(L))