import bpy, sys, collections
a=sys.argv[sys.argv.index("--")+1:]
bpy.ops.wm.read_factory_settings(use_empty=True); bpy.ops.import_scene.gltf(filepath=a[0])
for o in bpy.context.scene.objects:
    if o.type=="ARMATURE": o.data.pose_position="REST"
bpy.context.view_layer.update()
me=[o for o in bpy.context.scene.objects if o.type=="MESH" and not o.name.startswith("Ico")][0]; mw=me.matrix_world
for side,cond in (("LEFT x>0.5",lambda p:p.x>0.5),("RIGHT x<-0.5",lambda p:p.x<-0.5)):
    c=collections.Counter()
    for v in me.data.vertices:
        p=mw@v.co
        if cond(p):
            gs=sorted(v.groups,key=lambda g:-g.weight)
            if gs: c[me.vertex_groups[gs[0].group].name]+=1
    print(side,c.most_common(8))
