#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int dx[] = {0, 0, 1, -1};
int dy[] = {-1, 1, 0, 0};
int ara[200000], dp[200000];
int dp_func(int pos) {
  if (pos == 0) return 0;
  if (dp[pos] != -1) return dp[pos];
  int ret = 914748364;
  ret = min(ret, dp_func(pos - 1) + 20);
  for (int i = pos - 1; i >= 1; i--) {
    int d = ara[i] + 90 - 1;
    if (d < ara[pos]) break;
    ret = min(ret, dp_func(i - 1) + 50);
  }
  for (int i = pos - 1; i >= 1; i--) {
    int d = ara[i] + 1440 - 1;
    if (d < ara[pos]) break;
    ret = min(ret, dp_func(i - 1) + 120);
  }
  return dp[pos] = ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  int i, j, k, l, m, n;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &ara[i]);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    l = dp_func(i);
    printf("%d\n", l - sum);
    assert(l >= sum);
    sum += (l - sum);
  }
}
