The order doesn't matter. We use a prefix tree with longest path segment wins logic.