Problem:
Problem C: Find the Point

We understand that reading English is a great pain to many of you. So we’ll keep this problem statememt
simple. Write a program that reports the point equally distant from a set of lines given as the input. In
case of no solutions or multiple solutions, your program should report as such.

Input

The input consists of multiple datasets. Each dataset is given in the following format:

n

x1,1 y1,1 x1,2 y1,2

x2,1 y2,1 x2,2 y2,2

...

xn,1 yn,1 xn,2 yn,2

n is the number of lines (1 ≤ n ≤ 100); (xi,1, yi,1) and (xi,2, yi,2) denote the different points the i-th line passes through. The lines do not coincide each other. The coordinates are all integers between -10000
and 10000.

The last dataset is followed by a line containing one zero. This line is not a part of any dataset and should not be processed.

Output

For each dataset, print a line as follows. If there is exactly one point equally distant from all the given lines, print the x- and y-coordinates in this order with a single space between them. If there is more than one such point,
just print "Many" (without quotes). If there is none, just print "None" (without quotes).

The coordinates may be printed with any number of digits after the decimal point, but should be accurate
to 10-4.

Sample Input

2
-35 -35 100 100
-49 49 2000 -2000
4
0 0 0 3
0 0 3 0
0 3 3 3
3 0 3 3
4
0 3 -4 6
3 0 6 -4
2 3 6 6
-1 2 -4 6
0

Output for the Sample Input

Many
1.5000 1.5000
1.000 1.000

Solution in Ruby (judge verdict: Accepted)

ERROR = 1e-5

require 'mathn'
include Math
class Line
	require 'matrix'
	#ax+by = c   (a > 0 or (a == 0 && b > 0))
	def self.through_two_points(x1, y1, x2, y2)
		a = y1 - y2
		b = x2 - x1
		c = a * x1 + b * y1
		new(a, b, c)
	end

	def self.through_one_point(x, y, rad)
		a = sin(rad)
		b = -cos(rad)
		c = a * x + b * y
		new(a, b, c)
	end

	def cross_point(l)
		m = Matrix[
			[@a, @b],
			[l.a, l.b],
		];
		v = Vector[@c, l.c]
		(m.inv * v).to_a
	end

	def vertical?
		b == 0
	end

	def y(x)
		(c - a * x) / b
	end

	def x(y)
		(c - b * y) / a
	end

	def parallel?(l)
		(@a * l.b - @b * l.a).abs < ERROR
	end

	def angle
		atan2(@a, -@b)
	end 

	def dist(x, y)
		(@a * x + @b * y - c).abs / sqrt(@a ** 2 + @b ** 2)
	end

	def through?(x, y)
		(@a * x + @b * y - c).abs < ERROR
	end


	private_class_method :new

	def initialize(*args)
		@a, @b, @c = args	
		if @a < 0
			@a *= -1
			@b *= -1
			@c *= -1
		elsif @a == 0 && @b < 0
			@b *= -1
			@c *= -1
		end
	end

	attr_reader :a, :b, :c
end

loop do
	n = gets.to_i
	break if n == 0

	para_num = {}
	lines = []
	n.times do
		l = Line.through_two_points(*gets.split.map(&:to_i))
		if rep = para_num.keys.find {|rep| l.parallel?(rep)}
			para_num[rep] += 1
		else
			para_num[l] = 1
		end
		lines << l
	end

	if para_num.size == 1
		if para_num.values[0] < 3
			puts 'Many'
		else
			puts 'None'
		end
	elsif para_num.values.max >= 3
		puts 'None'
	elsif para_num.size == 2
		if para_num.values.max == 1
			puts 'Many'
		elsif para_num.values.min == 1
			puts 'Many'
		else
			l1 = lines.shift
			l2 = lines.find {|l| l.parallel?(l1)}
			l3, l4 = lines - [l2]
			l5, l6 = nil, nil
			if l1.vertical?
				l5 = Line.through_two_points((l1.x(0) + l2.x(0)) / 2, 0, (l1.x(1) + l2.x(1)) / 2, 1)
			else
				l5 = Line.through_two_points(0, (l1.y(0) + l2.y(0)) / 2, 1, (l1.y(1) + l2.y(1)) / 2)
			end
			if l3.vertical?
				l6 = Line.through_two_points((l3.x(0) + l4.x(0)) / 2, 0, (l3.x(1) + l4.x(1)) / 2, 1)
			else
				l6 = Line.through_two_points(0, (l3.y(0) + l4.y(0)) / 2, 1, (l3.y(1) + l4.y(1)) / 2)
			end

			x, y = l5.cross_point(l6)
			if (l1.dist(x, y) - l3.dist(x, y)).abs < ERROR
				puts [x.to_f, y.to_f].join " "
			else
				puts 'Many'
			end
		end
	else
		candidates = []
		l1, l2, l3 = para_num.keys[0..2]
		x, y = l1.cross_point(l2)
		if l3.through?(x, y)
			candidates << [x, y]
		else
			bisec = []
			[l1, l2, l3].combination(2) do |la, lb|
				bisec << Line.through_one_point(*la.cross_point(lb), (la.angle + lb.angle) / 2)
				bisec << Line.through_one_point(*la.cross_point(lb), (la.angle + lb.angle + PI) / 2)
			end
			bisec.combination(3) do |la, lb, lc|
				next if la.parallel?(lb) or la.parallel?(lc)
				x, y = la.cross_point(lb)
				candidates << [x, y] if lc.through?(x, y)
			end
		end

		ans = []
		candidates.each do |x, y|
			ds = lines.map{|l| l.dist(x, y)}
			d0 = ds.shift
			if ds.all?{|d| (d - d0).abs < ERROR}
				ans << [x, y]
			end
		end

		if ans.size > 1
			puts 'Many'
		elsif ans.size == 1
			puts ans.flatten.join " "
		else 
			puts 'None'
		end
	end
end