#!/usr/bin/env python3 # @EXPECTED_RESULTS@: ACCEPTED,WRONG_ANSWER from math import sqrt import sys # n = int(input()) ps = [] for line in sys.stdin.readlines()[1:]: ps.append(list(map(int, line.split()))) B = 10 L = (10**9 + B - 1) // B boxes = [[[[] for _ in range(B)] for _ in range(B)] for _ in range(B)] for [x, y, z] in ps: boxes[x // L][y // L][z // L].append((x, y, z)) ans = 3 * 10**9 for b1 in boxes: for b2 in b1: for b3 in b2: for (x1, y1, z1) in b3: for (x2, y2, z2) in b3: d = sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2 + (z1 - z2) ** 2) # By probability, d=0 won't happen in the input if d > 0: ans = min(ans, d) print(ans)