#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7, mod = 1e9 + 7, inf = 1e9 + 7;
const long long linf = (long long)1e18 + 7;
const long double eps = 1e-15, pi = 3.141592;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1},
          dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
int n;
int a[N];
long long dp[N], t[N << 2];
inline void update(int pos, long long val, int v = 1, int tl = 0, int tr = n) {
  if (tl == tr) {
    t[v] = val;
    return;
  }
  int tm = tl + tr >> 1;
  if (pos <= tm)
    update(pos, val, v + v, tl, tm);
  else
    update(pos, val, v + v + 1, tm + 1, tr);
  t[v] = min(t[v + v], t[v + v + 1]);
}
inline long long get(int l, int r, int v = 1, int tl = 0, int tr = n) {
  if (l <= tl && tr <= r) return t[v];
  if (tl > r || tr < l) return linf;
  int tm = tl + tr >> 1;
  return min(get(l, r, v + v, tl, tm), get(l, r, v + v + 1, tm + 1, tr));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), dp[i] = linf;
  for (int i = 1; i <= n; ++i) {
    int pos = lower_bound(a + 1, a + 1 + n, a[i] - 89) - a;
    if (pos >= 1 && pos < i) dp[i] = min(dp[i], get(pos - 1, i - 1) + 50);
    pos = lower_bound(a + 1, a + 1 + n, a[i] - 1439) - a;
    if (pos >= 1 && pos < i) dp[i] = min(dp[i], get(pos - 1, i - 1) + 120);
    dp[i] = min(dp[i], dp[i - 1] + 20);
    printf("%lld\n", dp[i] - dp[i - 1]);
    update(i, dp[i]);
  }
  exit(0);
}
