tag @s add bridge_snowball
tag @s add temp
execute on origin if entity @s[team=red] as @n[type=snowball,tag=temp] run tag @s add red
execute on origin if entity @s[team=blue] as @n[type=snowball,tag=temp] run tag @s add blue
data merge entity @s[tag=red] {Item:{id:"minecraft:red_wool",count:1}}
data merge entity @s[tag=blue] {Item:{id:"minecraft:blue_wool",count:1}}
tag @s remove temp