A Grammar of Motives