#include <bits/stdc++.h>
using namespace std;
long long int f[100010], n, a[100010];
const long long int inf = 2000000000000;
int main() {
  long long int i, j, k;
  scanf("%I64d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
  }
  f[0] = 0;
  sort(a + 1, a + 1 + n);
  for (i = 1; i <= n; i++) {
    f[i] = f[i - 1] + 20;
    long long int t;
    t = lower_bound(a + 1, a + 1 + n, a[i] - 89) - a - 1;
    f[i] = min(f[i], f[t] + 50);
    t = lower_bound(a + 1, a + 1 + n, a[i] - 1439) - a - 1;
    f[i] = min(f[i], f[t] + 120);
    printf("%I64d\n", f[i] - f[i - 1]);
  }
  return 0;
}
