#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> n;
  vector<long long> ar(n + 2, 1000000000010LL);
  ar[1] = 0;
  ar[0] = 0;
  queue<int> d, z;
  map<int, int> p;
  long long sm = 0;
  for (int i = 0; i < n; i++) {
    cin >> t;
    p.insert(pair<int, int>(t, i + 1));
    d.push(t);
    z.push(t);
    while (t - 89 > d.front()) d.pop();
    while (t - 1439 > z.front()) z.pop();
    int q = d.front(), o = z.front();
    long long f = ar[p[q] - 1] + 50, y = ar[p[o] - 1] + 120;
    ar[i + 1] = min(f, min(y, ar[i] + 20));
    long long h = max(0LL, min(f, min(y, ar[i] + 20)) - sm);
    sm += h;
    cout << h << endl;
  }
}
