class ConvexHull {
    private static class Point implements Comparable<Point> {
        private int x, y

        Point(int x, int y) {
            this.x = x
            this.y = y
        }

        @Override
        int compareTo(Point o) {
            return Integer.compare(x, o.x)
        }

        @Override
        String toString() {
            return String.format("(%d,%d)", x, y)
        }
    }

    private static List<Point> convexHull(List<Point> p) {
        if (p.isEmpty()) return Collections.emptyList()
        p.sort(new Comparator<Point>() {
            @Override
            int compare(Point o1, Point o2) {
                return o1 <=> o2
            }
        })
        List<Point> h = new ArrayList<>()