#include <bits/stdc++.h>
using namespace std;
int a[100005], dp[100005];
int bs(int n, int x) {
  int l = 1, r = n, ret = n;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (a[mid] < x)
      l = mid + 1;
    else {
      ret = min(ret, mid);
      r = mid - 1;
    }
  }
  if (a[r] >= x) ret = min(ret, r);
  return ret;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  cout << 20 << endl;
  dp[0] = 0;
  dp[1] = 20;
  int sum = 20;
  for (int i = 2; i <= n; i++) {
    dp[i] = dp[i - 1] + 20;
    int l1 = bs(i, a[i] - 90 + 1);
    int l2 = bs(i, a[i] - 1440 + 1);
    if (dp[l1 - 1] + 50 < dp[i]) dp[i] = dp[l1 - 1] + 50;
    if (dp[l2 - 1] + 120 < dp[i]) dp[i] = dp[l2 - 1] + 120;
    printf("%d\n", dp[i] - sum);
    sum = dp[i];
  }
}
