#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int cst[100007];
int main(void) {
  int n, i, x, y;
  scanf("%d", &n);
  cst[0] = 0;
  deque<int> dq90;
  deque<int> dqday;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    mp[x] = i;
    cst[i] = 20 + cst[i - 1];
    dq90.push_front(x);
    dqday.push_front(x);
    while (1) {
      y = dq90.back();
      if (x - y >= 90)
        dq90.pop_back();
      else
        break;
    }
    cst[i] = min(cst[i], 50 + cst[mp[dq90.back()] - 1]);
    while (1) {
      y = dqday.back();
      if (x - y >= 1440)
        dqday.pop_back();
      else
        break;
    }
    cst[i] = min(cst[i], 120 + cst[mp[dqday.back()] - 1]);
    printf("%d\n", cst[i] - cst[i - 1]);
  }
  return 0;
}
