There are apples and oranges in a basket that can carry a maximum of 50 fruits. Some fruits are rotten and some are good. The number of rotten apples is twice the number of good apples. The number of good oranges is twice the number of rotten oranges. The number of oranges is thrice the number of apples. If there are more than 40 fruits in the basket, what is the total number of apples and oranges?