Insert item types serially to ensure parent-child relation.
Use aggregation to generate grades. Item insertion back to parallel.