#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int pre[100005];
int main() {
  int t1, t2;
  int temp;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    t1 = upper_bound(a, a + i, a[i] - 90) - a;
    t2 = upper_bound(a, a + i, a[i] - 1440) - a;
    if (pre[i] - pre[t1] >= 50 || pre[i] - pre[t2] >= 120) {
      printf("0\n");
      pre[i + 1] = pre[i];
      continue;
    }
    if (50 - (pre[i] - pre[t1]) >= 20 && 120 - (pre[i] - pre[t2]) >= 20) {
      printf("20\n");
      pre[i + 1] = pre[i] + 20;
      continue;
    }
    temp = min(50 - (pre[i] - pre[t1]), 120 - (pre[i] - pre[t2]));
    printf("%d\n", temp);
    pre[i + 1] = pre[i] + temp;
  }
  return 0;
}
