A new innovative ticketing systems for public transport is introduced in Bytesburg. Now there is a single travel card for all transport. To make a trip a passenger scan his card and then he is charged according to the fare.
The fare is constructed in the following manner. There are three types of tickets:
1. a ticket for one trip costs 20 byteland rubles,
2. a ticket for 90 minutes costs 50 byteland rubles,
3. a ticket for one day (1440 minutes) costs 120 byteland rubles.
Note that a ticket for _x_ minutes activated at time _t_ can be used for trips started in time range from _t_ to _t_ + _x_ - 1, inclusive. Assume that all trips take exactly one minute.
To simplify the choice for the passenger, the system automatically chooses the optimal tickets. After each trip starts, the system analyses all the previous trips and the current trip and chooses a set of tickets for these trips with a minimum total cost. Let the minimum total cost of tickets to cover all trips from the first to the current is _a_, and the total sum charged before is _b_. Then the system charges the passenger the sum _a_ - _b_.
You have to write a program that, for given trips made by a passenger, calculates the sum the passenger is charged after each trip.
## Input
The first line of input contains integer number _n_ (1 ≤ _n_ ≤ 105) — the number of trips made by passenger.
Each of the following _n_ lines contains the time of trip _t__i_ (0 ≤ _t__i_ ≤ 109), measured in minutes from the time of starting the system. All _t__i_ are different, given in ascending order, i. e. _t__i_ + 1 > _t__i_ holds for all 1 ≤ _i_ < _n_.
## Output
Output _n_ integers. For each trip, print the sum the passenger is charged after it.
[samples]
## Note
In the first example, the system works as follows: for the first and second trips it is cheaper to pay for two one-trip tickets, so each time 20 rubles is charged, after the third trip the system understands that it would be cheaper to buy a ticket for 90 minutes. This ticket costs 50 rubles, and the passenger had already paid 40 rubles, so it is necessary to charge 10 rubles only.
在比特堡,一种新颖的公共交通票务系统被引入。现在所有交通工具都使用一张通用交通卡。乘客刷卡后,系统将根据票价收费。
票价结构如下:共有三种票种:
请注意,一个在时间 #cf_span[t] 激活的 #cf_span[x] 分钟票,可用于从时间 #cf_span[t] 到 #cf_span[t + x - 1](含)之间开始的行程。假设所有行程耗时恰好为一分钟。
为简化乘客的选择,系统会自动选择最优票务组合。每次行程开始后,系统会分析所有之前的行程以及当前行程,并为这些行程选择一组总成本最小的票。设覆盖从第一趟到当前行程的所有行程所需的最小总成本为 #cf_span[a],此前已收取的总金额为 #cf_span[b],则系统向乘客收取 #cf_span[a - b] 的金额。
你需要编写一个程序,根据乘客的行程记录,计算每次行程后乘客被收取的金额。
输入的第一行包含整数 #cf_span[n](#cf_span[1 ≤ n ≤ 105])——乘客的行程数量。
接下来的 #cf_span[n] 行每行包含一次行程的时间 #cf_span[ti](#cf_span[0 ≤ ti ≤ 109]),以系统启动后经过的分钟数为单位。所有 #cf_span[ti] 互不相同,且按升序给出,即对所有 #cf_span[1 ≤ i < n] 都满足 #cf_span[ti + 1 > ti]。
请输出 #cf_span[n] 个整数。对于每次行程,输出该行程后乘客被收取的金额。
在第一个示例中,系统工作方式如下:对于第一和第二趟行程,购买两张单次票更便宜,因此每次收取 #cf_span[20] 卢布;在第三趟行程后,系统发现购买一张 90 分钟票更划算。该票售价 #cf_span[50] 卢布,而乘客此前已支付 #cf_span[40] 卢布,因此只需再收取 #cf_span[10] 卢布。
## Input
输入的第一行包含整数 #cf_span[n](#cf_span[1 ≤ n ≤ 105])——乘客的行程数量。接下来的 #cf_span[n] 行每行包含一次行程的时间 #cf_span[ti](#cf_span[0 ≤ ti ≤ 109]),以系统启动后经过的分钟数为单位。所有 #cf_span[ti] 互不相同,且按升序给出,即对所有 #cf_span[1 ≤ i < n] 都满足 #cf_span[ti + 1 > ti]。
## Output
输出 #cf_span[n] 个整数。对于每次行程,输出该行程后乘客被收取的金额。
[samples]
## Note
在第一个示例中,系统工作方式如下:对于第一和第二趟行程,购买两张单次票更便宜,因此每次收取 #cf_span[20] 卢布;在第三趟行程后,系统发现购买一张 90 分钟票更划算。该票售价 #cf_span[50] 卢布,而乘客此前已支付 #cf_span[40] 卢布,因此只需再收取 #cf_span[10] 卢布。
**Definitions**
Let $ n \in \mathbb{Z}^+ $ be the number of trips.
Let $ T = (t_1, t_2, \dots, t_n) $ be the sequence of trip times, where $ 0 \le t_1 < t_2 < \dots < t_n \le 10^9 $.
Let the ticket types be:
- Type 1: costs $ c_1 $, valid for 1 trip.
- Type 2: costs $ c_2 $, valid for 90 minutes.
- Type 3: costs $ c_3 $, valid for 1440 minutes.
For a ticket of type $ x $ activated at time $ t $, it covers all trips occurring in $ [t, t + d_x - 1] $, where $ d_1 = 1, d_2 = 90, d_3 = 1440 $.
Let $ a_k $ denote the minimum total cost to cover trips $ t_1, \dots, t_k $.
Let $ b_k $ denote the total amount charged before trip $ k $ (i.e., $ b_k = \sum_{i=1}^{k-1} \text{charge}_i $), with $ b_1 = 0 $.
**Constraints**
1. $ 1 \le n \le 10^5 $
2. $ 0 \le t_i \le 10^9 $, strictly increasing
3. $ c_1, c_2, c_3 \in \mathbb{R}^+ $ (fixed, given constants)
**Objective**
For each trip $ k \in \{1, \dots, n\} $, compute:
$$
\text{charge}_k = a_k - b_k
$$
where
$$
a_k = \min \left\{
\begin{array}{l}
a_{k-1} + c_1, \\
\min_{\substack{j \le k \\ t_k - t_j + 1 \le 90}} \{ a_{j-1} + c_2 \}, \\
\min_{\substack{j \le k \\ t_k - t_j + 1 \le 1440}} \{ a_{j-1} + c_3 \}
\end{array}
\right.
$$
with $ a_0 = 0 $.