Wrote nested-group-by.