Writes ports before components before junctions.