There were an equal number of Carrots, Tomatoes and Cabbages in a pantry. Yiguo, used 49 carrots and some tomatoes and Cabbages. There were 3 times as many tomatoes as cabbages left. 16 fewer carrots than tomatoes left. There were 117 carrots, tomatoes and cabbages left altogether. How many carrots were in the pantry at first.