#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e16;
const int MAX = 1e5;
long long dp[MAX][3];
int N;
vector<long long> A;
long long f(int i, int last) {
  if (i < 0) {
    return 0;
  }
  if (dp[i][last] != -1) {
    return dp[i][last];
  }
  long long ans = 20 + f(i - 1, 0);
  int prevIndex = lower_bound(A.begin(), A.end(), A[i] - 90) - A.begin();
  if (A[prevIndex] > A[i] - 90 || prevIndex == i) {
    --prevIndex;
  }
  ans = min(ans, 50 + f(prevIndex, 1));
  prevIndex = lower_bound(A.begin(), A.end(), A[i] - 1440) - A.begin();
  if (A[prevIndex] > A[i] - 1440 || prevIndex == i) {
    --prevIndex;
  }
  ans = min(ans, 120 + f(prevIndex, 2));
  return dp[i][last] = ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  for (int i = 0, x; i < N; ++i) {
    cin >> x;
    A.push_back(x);
  }
  memset(dp, -1, sizeof(dp));
  f(N - 1, 0);
  for (int i = 0; i < MAX; ++i) {
    for (int j = 0; j < 3; ++j) {
      if (dp[i][j] == -1) {
        dp[i][j] = INF;
      }
    }
  }
  cout << min(dp[0][0], min(dp[0][1], dp[0][2])) << '\n';
  long long prev = min(dp[0][0], min(dp[0][1], dp[0][2])), t;
  for (int i = 1; i < N; ++i) {
    t = min(dp[i][0], min(dp[i][1], dp[i][2]));
    cout << (t - prev) << '\n';
    prev = t;
  }
  return 0;
}
