Ally has 8 red marbles and 16 green marbles. She also has red bags and green bags. She wants to put marbles in the bags that match their color. Each bag will have the same number of marbles. What is the largest number of marbles she can put into each bag?