#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(1e9);
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  set<int> S;
  map<int, int> M;
  vector<int> t(n, INF);
  set<int>::iterator it;
  for (int i = 0; i < n; ++i) {
    int T;
    cin >> T;
    S.insert(-T);
    M[-T] = i;
    t[i] = (i ? t[i - 1] + 20 : 20);
    it = S.lower_bound(-T + 90);
    if (it != S.end()) {
      int j = M[*it];
      t[i] = min(t[i], t[j] + 50);
    } else
      t[i] = min(t[i], 50);
    it = S.lower_bound(-T + 1440);
    if (it != S.end()) {
      int j = M[*it];
      t[i] = min(t[i], t[j] + 120);
    } else
      t[i] = min(t[i], 120);
    cout << (i ? t[i] - t[i - 1] : t[i]) << endl;
  }
}
