Group theory from “quarks” at the ends of strings