Task: Program Execution
Input (English): n, d, W, 5803, x
Output (English): 1, 2, 3, 5