#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> times(n);
  for (int i = 0; i < n; i++) {
    cin >> times[i];
  }
  vector<int> dp(n);
  dp[0] = 20;
  for (int i = 1; i < n; i++) {
    dp[i] = 20 + dp[i - 1];
    int curr = i;
    for (int j = 20; j >= 0; j--) {
      int next_i = max(0, curr - (1 << j));
      if (times[next_i] + 90 - 1 >= times[i]) {
        curr = next_i;
      }
    }
    if (curr == 0) {
      dp[i] = min(dp[i], 50);
    } else {
      dp[i] = min(dp[i], 50 + dp[curr - 1]);
    }
    curr = i;
    for (int j = 20; j >= 0; j--) {
      int next_i = max(0, curr - (1 << j));
      if (times[next_i] + 1440 - 1 >= times[i]) {
        curr = next_i;
      }
    }
    if (curr == 0) {
      dp[i] = min(dp[i], 120);
    } else {
      dp[i] = min(dp[i], 120 + dp[curr - 1]);
    }
  }
  int alr = 0;
  for (int i = 0; i < n; i++) {
    cout << dp[i] - alr << "\n";
    alr = dp[i];
  }
}
