Ernie went to the store and bought 33 apples. He bought three times as many red apples as he bought green, and he bought one-half as many yellow as he did red. How many of each type of apple did he buy?