<a href="https://codeforces.com/contest/56/problem/E">https://codeforces.com/contest/56/problem/E</a>
Input Format
.
Output Format
.
Constraints
.
Notice
.
Example
Input
4 16 5 20 5 10 10 18 2
Output
3 1 4 1