solutions to poj