#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
vector<int> v;
int next2[N], next3[N];
int pd[N];
int solve(int pos) {
  if (pos < 0) return 0;
  if (pd[pos] != -1) return pd[pos];
  pd[pos] = 20 + solve(pos - 1);
  pd[pos] = min(pd[pos], 50 + solve(next2[pos]));
  pd[pos] = min(pd[pos], 120 + solve(next3[pos]));
  return pd[pos];
}
int main() {
  memset(pd, -1, sizeof(pd));
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    v.push_back(x);
  }
  for (int i = n - 1; i >= 0; i--) {
    int pos = lower_bound(v.begin(), v.end(), v[i] - 89) - v.begin();
    next2[i] = pos - 1;
    pos = lower_bound(v.begin(), v.end(), v[i] - 1439) - v.begin();
    next3[i] = pos - 1;
  }
  for (int i = 0; i < n; i++) {
    int a = solve(i);
    int b = i == 0 ? 0 : solve(i - 1);
    printf("%d\n", a - b);
  }
  return 0;
}
