// Arup Guha
// 1/8/2017
// Solution to 2016 December USACO Gold Problem: Moocast

import java.util.*;
import java.io.*;

public class moocast_gold {

	public static int n;
	public static int[][] pts;

	public static void main(String[] args) throws Exception {

		// Get input.
		Scanner stdin = new Scanner(new File("moocast.in"));
		n = stdin.nextInt();
		pts = new int[n][2];
		for (int i=0; i<n; i++)
			for (int j=0; j<2; j++)
				pts[i][j] = stdin.nextInt();

		// Set up bounds for binary search.
		long low = 1L, high = 25000*25000*2L;

		// Run binary search.
		while (low < high) {
			long mid = (low+high)/2;
			if (possible(mid))
				high = mid;
			else
				low = mid+1;
		}

		// Output result.
		PrintWriter out = new PrintWriter(new FileWriter("moocast.out"));
		out.println(low);
		out.close();
		stdin.close();
	}

	// Returns true iff a value of max allows all the cows to talk.
	public static boolean possible(long max) {
		boolean[] used = new boolean[n];
		floodfill(0, max, used);
		for (int i=0; i<n; i++)
			if (!used[i])
				return false;
		return true;
	}

	// Just run a floodfill - good enough for their bounds.
	public static void floodfill(int v, long max, boolean[] used) {
		used[v] = true;
		for (int i=0; i<n; i++) {
			if (used[i]) continue;
			if ((pts[i][0]-pts[v][0])*(pts[i][0]-pts[v][0])+ (pts[i][1]-pts[v][1])*(pts[i][1]-pts[v][1]) <= max)
				floodfill(i, max, used);
		}
	}
}