We’re preparing your current view and syncing the latest data.
Valera has n tubes, each painted in one of three colors (red, green, blue). He wants to create new tubes by gluing together segments according to the counts of each color. Given the initial tubes and how many segments of each color required per new tube, determine the maximum number of such new tubes Valera can create and how many segments of each color will remain unused.
The first line contains four integers n, r, g, b (1 ≤ n ≤ 10^5; 0 ≤ r,g,b ≤ 10^9) — the number of initial tubes, and the required segments of red, green, and blue for each new tube, respectively. The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9) — the colors of each tube: 1 for red, 2 for green, and 3 for blue.
Print two lines:
1 ≤ n ≤ 10^5 1 ≤ a_i ≤ 3 0 ≤ r,g,b ≤ 10^9
Example 1
Input
5 1 1 1 1 2 3 3 3
Output
1 0 0 2
Explanation
There are 5 tubes: 1 red, 1 green, 3 blue. Requirements per new tube: 1 red, 1 green, 1 blue. Maximum tubes possible is min(1/1,1/1,3/1) = 1. Leftover segments: red=1-1=0, green=1-1=0, blue=3-1=2.