#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 7, SZ = 3 * 1e8;
const long long MODM = 1e9 + 7, INF = 1e18 + 1;
long long a[MAXN];
map<long long, long long> ans, sum;
set<long long> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sum[a[0]] = 20;
  q.insert(a[0]);
  cout << 20 << "\n";
  for (int i = 1; i < n; ++i) {
    long long now = 0;
    now = sum[a[i - 1]] + 20;
    q.insert(a[i]);
    auto to = q.lower_bound(a[i] - 90 + 1);
    long long prev = 0;
    if (to != q.begin()) {
      to--;
      prev = sum[*to];
    }
    now = min(now, prev + 50);
    to = q.lower_bound(a[i] - 1440 + 1);
    prev = 0;
    if (to != q.begin()) {
      to--;
      prev = sum[*to];
    }
    now = min(now, prev + 120);
    sum[a[i]] = now;
    cout << now - sum[a[i - 1]] << "\n";
  }
  return 0;
}
