UVa 133 - The Dole Queue

133 - The Dole Queue

 * http://acm.uva.es/p/v1/133.html

Summary
A standard Simulation problem.

Explanation
A standard Simulation problem.

Input
10 4 3 0 0 0

Output
4 8,  9  5,  3  1,  2  6, 10,  7