#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int s = 0;
  map<int, int> m;
  m[179179] = 0;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    int v1 = 20 + m.lower_bound(-t)->second;
    int v2 = 50 + m.lower_bound(-(t - 90))->second;
    int v3 = 120 + m.lower_bound(-(t - 1440))->second;
    int v = min(v1, min(v2, v3));
    m[-t] = v;
    cout << v - s << '\n';
    s = v;
  }
}
