#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const double eps = 1e-8;
int a[100005];
int cost[100005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    int hour = 0;
    int day = 0;
    int nxt = 0;
    int c, b;
    int tmp;
    for (int i = 1; i <= n; ++i) {
      day = lower_bound(a + 1, a + n + 1, a[i] - 1440 + 1) - a;
      hour = lower_bound(a + 1, a + n + 1, a[i] - 90 + 1) - a;
      c = max(cost[day - 1] + 120 - cost[i - 1], 0);
      b = max(cost[hour - 1] + 50 - cost[i - 1], 0);
      tmp = min(20, min(c, b));
      cost[i] = cost[i - 1] + tmp;
      cout << tmp << "\n";
    }
  }
  return 0;
}
