#include <bits/stdc++.h>
using namespace std;
int main() {
  const int R = 90, D = 1440, S = 20, B = 50, L = 120;
  long n;
  scanf("%ld", &n);
  std::vector<long> t(n + 1, 0), me(n + 1, 0);
  long tb(0), td(0);
  for (int p = 1; p <= n; ++p) {
    scanf("%ld", &t[p]);
    while (t[tb + 1] + R <= t[p]) {
      ++tb;
    }
    while (t[td + 1] + D <= t[p]) {
      ++td;
    }
    me[p] = ((me[p - 1] + S) < (me[tb] + B)) ? (me[p - 1] + S) : (me[tb] + B);
    me[p] = (me[p] < (me[td] + L)) ? me[p] : (me[td] + L);
    printf("%ld\n", me[p] - me[p - 1]);
  }
  return 0;
}
