#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e5;
int arr[maxN];
struct Node {
  Node *l = NULL, *r = NULL;
  Node(Node *l, Node *r) : l(l), r(r) {}
  Node(int, int);
  long long best;
  long long getBest(int, int, int);
  void insert(int, int, int, int, long long);
};
Node::Node(int left, int right) {
  best = LLONG_MAX;
  if (left + 1 == right) return;
  int mid = (left + right) >> 1;
  l = new Node(left, mid);
  r = new Node(mid, right);
}
long long Node::getBest(int left, int right, int w) {
  if (w < left || w >= right) return LLONG_MAX;
  if (left + 1 == right) return best;
  int mid = (left + right) >> 1;
  return min(l->getBest(left, mid, w), min(best, r->getBest(mid, right, w)));
}
void Node::insert(int left, int right, int u, int v, long long cmp) {
  if (v <= left || u >= right) return;
  if (u <= left && right <= v) {
    best = min(best, cmp);
    return;
  }
  int mid = (left + right) >> 1;
  l->insert(left, mid, u, v, cmp);
  r->insert(mid, right, u, v, cmp);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  Node *tree = new Node(0, n + 1);
  tree->insert(0, n + 1, 0, 1, 0);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= n; i++) {
    long long curBest = tree->getBest(0, n + 1, i - 1);
    tree->insert(0, n + 1, i, i + 1, curBest + 20);
    tree->insert(0, n + 1, i,
                 int(lower_bound(arr, arr + n, arr[i - 1] + 90) - arr) + 1,
                 curBest + 50);
    tree->insert(0, n + 1, i,
                 int(lower_bound(arr, arr + n, arr[i - 1] + 1440) - arr) + 1,
                 curBest + 120);
  }
  long long prev = 0, cur;
  for (int i = 0; i < n; i++) {
    cur = tree->getBest(0, n + 1, i + 1);
    cout << cur - prev << '\n';
    prev = cur;
  }
}
