#include <stdio.h>

#define SIZE 100010

struct ride {

int cost, t;

} r[SIZE];

int main()

{

int i, j, n;

scanf(“%d”, &n);

r[0].t = r[0].cost = 0;

for (i = 1; i <= n; i++)

{

scanf(“%d”, &r[i].t);

r[i].cost = r[i – 1].cost + 20;

for (j = i; j > 0 && (r[j].t + 90 > r[i].t); j–)

if (r[j – 1].cost + 50 < r[i].cost)

r[i].cost = r[j – 1].cost + 50;

for (j = i; j > 0 && (r[j].t + 1440 > r[i].t); j–)

if (r[j – 1].cost + 120 < r[i].cost)

r[i].cost = r[j – 1].cost + 120;

printf(” %d\n”, r[i].cost – r[i – 1].cost);

}

return 0;

}