#include <bits/stdc++.h>
using namespace std;
const long long N = 100005, val1 = 20, val2 = 50, val3 = 120;
long long in[N], sum[N];
int n;
long long Sum(int pos) {
  if (pos < 0) return 0LL;
  return sum[pos];
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> in[i];
  for (int i = 0; i < n; i++) {
    int t1 = in[i], t2 = in[i] - 90 + 1, t3 = in[i] - 1440 + 1;
    int pos2 = lower_bound(in, in + n, t2) - in - 1;
    int pos3 = lower_bound(in, in + n, t3) - in - 1;
    int pos1 = i - 1;
    long long Min = val1 + Sum(pos1);
    Min = min(Min, Sum(pos2) + val2);
    Min = min(Min, Sum(pos3) + val3);
    sum[i] = Min;
    cout << Min - sum[i - 1] << "\n";
  }
  return 0;
}
