// Arup Guha
// 7/15/2026
// Solution to UCF 1995 HS Contest Problem: I Can't Hear You

import java.util.*;

public class hear {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int m = stdin.nextInt();
		
		// Process cases.
		while (n != 0) {
			
			// Read the first set.
			pt[] first = new pt[n];
			for (int i=0; i<n; i++) {
				double x = stdin.nextDouble();
				double y = stdin.nextDouble();
				first[i] = new pt(x, y);
			}
			
			// Read the second set.
			pt[] second = new pt[m];
			for (int i=0; i<m; i++) {
				double x = stdin.nextDouble();
				double y = stdin.nextDouble();
				second[i] = new pt(x, y);
			}
			
			// Brute force is good enough for these bounds.
			double res = first[0].dist(second[0]);
			for (int i=0; i<n; i++)
				for (int j=0; j<m; j++)
					res = Math.min(res, first[i].dist(second[j]));
			
			// Use their format.
			System.out.printf("The distance between the closest pair of customers is %.2f.\n", res);
		
			// Get next case.
			n = stdin.nextInt();
			m = stdin.nextInt();
		}
	}
}

class pt {
	
	public double x;
	public double y;
	
	public pt(double myx, double myy) {
		x = myx;
		y = myy;
	}
	
	// Returns the distance between this and other.
	public double dist(pt other) {
		return Math.sqrt( (x-other.x)*(x-other.x) + (y-other.y)*(y-other.y) );
	}
}