Beat the soft butter with half the sugar. Add 6 egg yolks and sift the flour with baking powder and vanilla. Knead a dough, divide it into three balls. To one of the balls of dough, add the cocoa (dust the counter and knead until the cocoa is fully absorbed). Place all three balls of dough in the refrigerator to harden.
Beat the egg whites with the remaining sugar 2/5 cup (100 g) and add the coarsely chopped walnuts to it. In a greased rectangular oven dish, grate one white ball of dough, put sour cherry jam on top, grate the second cocoa ball and add the beaten egg whites and walnuts.
Finally, grate the last ball of dough. Bake for 30-40 minutes in a moderate oven, until ready.