#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 6;
int n, t[MX];
long long cheaters = 1e10;
double trump = 0.108;
int dp_arr[MX];
int fun2(int x, int jump);
int fun1(int x);
int mypowerfun(int a, int b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  int x = mypowerfun(a, b / 2);
  if (b % 2 == 0)
    return x * x;
  else
    return x * x * a;
}
void pritarr(int arr, int n) {
  int a[n];
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}
int isarrsorted(int a[], int n) {
  int i;
  for (i = 0; i < n - 1; i++) {
    if (a[i] > a[i] + 1) return 0;
  }
  return 1;
}
int gcd(int a, int b) {
  if (b != 0)
    return gcd(b, a % b);
  else
    return a;
}
int main() {
  cin >> n;
  memset(dp_arr, -1, sizeof dp_arr);
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", t + i);
    cout << fun1(i) - res << endl;
    res = fun1(i);
  }
  return 0;
}
int fun1(int x) {
  if (x < 1) return 0;
  if (dp_arr[x] != -1) return dp_arr[x];
  int res = 1e8, id = fun2(x, 1439);
  if (id < x) res = min(res, 120 + fun1(id - 1));
  id = fun2(x, 89);
  if (id < x) res = min(res, 50 + fun1(id - 1));
  res = min(res, 20 + fun1(x - 1));
  return dp_arr[x] = res;
}
int fun2(int x, int jump) {
  int st = 1;
  int en = x, ret = 1e6;
  while (st <= en) {
    int mfun2 = (st + en) / 2;
    if (t[x] - jump <= t[mfun2]) {
      ret = min(ret, mfun2);
      en = mfun2 - 1;
    } else
      st = mfun2 + 1;
  }
  return ret;
}
