#include <bits/stdc++.h>
using namespace std;
const int INF = 10000000000;
long long n, a, b, c;
vector<long long> v(100001, 0);
vector<long long> d(100001, 0);
int find_(int, int, int);
int main() {
  cin >> n;
  v[0] = d[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    a = d[find_(v[i] - 89, 1, i - 1)] + 50;
    b = d[find_(v[i] - 1439, 1, i - 1)] + 120;
    c = d[i - 1] + 20;
    d[i] = min(a, min(b, c));
    a = d[i] - d[i - 1];
    printf("%I64d\n", a);
  }
  return 0;
}
int find_(int x, int L, int R) {
  if (x < 0) return 0;
  while (L < R) {
    int m = (L + R) / 2;
    if (v[m] >= x)
      R = m;
    else
      L = m + 1;
  }
  return R - 1;
}
