#include <bits/stdc++.h>
using namespace std;
long long t[100005];
long long ans[100005] = {0};
int n;
long long bsearch(long long key, int i) {
  int low = 1, high = i - 1;
  while (low < high) {
    int mid = (low + high) / 2;
    if (t[mid] > key)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &t[i]);
  }
  long long sofar = 0;
  for (int i = 1; i <= n; i++) {
    long long int tim = t[i];
    long long val = 20, val2 = 50, val3 = 120;
    val += ans[i - 1];
    val2 += ans[bsearch(tim - 90, i) - 1];
    val3 += ans[bsearch(tim - 1440, i) - 1];
    printf("%lld\n", min(val, min(val2, val3)) - sofar);
    sofar += min(val, min(val2, val3)) - sofar;
    ans[i] = sofar;
  }
  return 0;
}
