while surfing the network I've meet a cool question picture - this is a script which tryes to solve the question