#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long mod2 = 1e9 + 9;
double eps = 1e-9;
int n, m;
const int size = 1e5 + 1;
int trip[size];
void clear_que(deque<pair<int, int> > &dq, int durat, int time) {
  pair<int, int> last_removed;
  while (1) {
    last_removed = dq.front();
    dq.pop_front();
    if (!dq.size() || dq.front().first >= time - durat + 1) {
      dq.push_front(last_removed);
      break;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> trip[i];
  deque<pair<int, int> > dayq, hourq;
  int prevc = 0;
  dayq.push_back({0, 0}), hourq.push_back({0, 0});
  for (int i = 0; i < n; ++i) {
    int curr = 20 + prevc;
    clear_que(hourq, 90, trip[i]);
    clear_que(dayq, 1440, trip[i]);
    curr = min(curr, hourq.front().second + 50);
    curr = min(curr, dayq.front().second + 120);
    cout << (curr - prevc) << '\n';
    prevc = curr;
    hourq.push_back({trip[i], curr});
    dayq.push_back({trip[i], curr});
  }
  cin >> n;
}
