import math
import sys

def distance(p1, p2):
    return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)

def closest_distance():
    print "please enter text. Hit return key after entering text:"
    line = raw_input()
    L = [] 
    while line:
        L.append(map(float, line.split())) # split at the occurrence of white-space and ad numbers as nested lists
        line = raw_input()

    min = sys.maxint          
    for i in range(len(L)):          # iterate by index through all the values in the list
        for j in range(i+1, len(L)):      # iterate by index through all later points
            dist = distance(L[i], L[j])
            if dist < min: # compare against our minimum distance
                    min = dist # store distance and the points if it is the minimum distance
                    index1 = i
                    index2 = j
                    
    print "The closest point pair is point", index1+1, "=", L[index1], "and point", index2+1, "=", L[index2]

#main program
closest_distance()
