Hey community I'm having issues with the following inequality word problem:

A jar contains between 40 and 50 marbles. If the marbles are taken out of the jar three at a time, two marbles will be left in the jar. If the marbles are taken out the jar five at a time, four marbles will be left in the jar. How many marbles are in the jar?

Now I know that the number of marbles is between 40 & 50. Considering such a quantity and thinking logically I assumed the number of marbles in the jar would have to be 48 if there was only to left after after several deductions of a set of three. But then if deductions of 5 were made until there was a remainder of 4 left then there must be 49 marbles in the jar, right? I'm confused.