How to get revenge on someone that stole your idea for something?

Last week, I bought the full version of GarageBand, and created a melody for a song that our music teacher and our class are making. After I played it to him, he said it is OK, and he used a melody similar to mine. Then when we were going back to class, I told a kid in our class that I used GarageBand, and I told him how awesome it is. Then when the kid got home, he seceretly bought GarageBand, and made a melody that's better than mine. Next music class, he brought his iphone with the melody on it and played it to the teacher. The teacher appreciated his melody more than mine, and way more many kids liked his melody more than mine, and our music teacher used his exact melody for the song. How do I get revenge on him for stealing my idea of making a melody for our song?

Thats what the witch does on me to transfer my ideas to my older brother.

Wait for karma to get him, or just find out where he lives and kill him.