#include <bits/stdc++.h>
using namespace std;
int n, sum;
set<pair<int, int> > myset;
set<pair<int, int> >::iterator it;
int main() {
  cin >> n;
  myset.insert({0, 0});
  for (int i = 1; i <= n; i++) {
    int time, x;
    x = sum + 20;
    cin >> time;
    it = myset.lower_bound({time - 90 + 1, 0});
    if (it != myset.end()) {
      if (it != myset.begin()) it--;
      x = min(x, it->second + 50);
    }
    it = myset.lower_bound({time - 1440 + 1, 0});
    if (it != myset.end()) {
      if (it != myset.begin()) it--;
      x = min(x, it->second + 120);
    }
    cout << x - sum << '\n';
    sum = x;
    myset.insert({time, x});
  }
  return 0;
}
