#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int timeP[n];
  map<int, int> index;
  for (int i = 0; i < n; i++) {
    cin >> timeP[i];
    index[timeP[i]] = i;
  }
  set<int> time;
  long int dp[n + 1];
  dp[0] = 0;
  dp[1] = 20;
  time.insert(timeP[0]);
  long int payed = 20;
  cout << dp[1] << "\n";
  for (int i = 1; i < n; i++) {
    dp[i + 1] = dp[i] + 20;
    auto lowerBound = time.lower_bound(timeP[i] - 89);
    if (lowerBound == time.begin())
      dp[i + 1] = min(50L, dp[i + 1]);
    else {
      lowerBound--;
      int prevTime = *lowerBound;
      int ind = index[prevTime];
      dp[i + 1] = min(dp[i + 1], 50 + dp[ind + 1]);
    }
    auto lower = time.lower_bound(timeP[i] - 1439);
    if (lower == time.begin())
      dp[i + 1] = min(120L, dp[i + 1]);
    else {
      lower--;
      int prevTime = *lower;
      int ind = index[prevTime];
      dp[i + 1] = min(dp[i + 1], 120 + dp[ind + 1]);
    }
    cout << dp[i + 1] - payed << "\n";
    payed += dp[i + 1] - payed;
    time.insert(timeP[i]);
  }
}
