#include <bits/stdc++.h>
using namespace std;
long long n;
long long t[100005];
const long long inf = 1e10;
long long dp[100005][4];
int main() {
  memset(t, 0, sizeof(t));
  for (int i = 0; i < 100005; i++) {
    for (int j = 0; j < 4; j++) dp[i][j] = inf;
  }
  cin >> n;
  long long minute = 0;
  long long day = 0;
  for (int i = 0; i < n; i++) {
    cin >> t[i];
    if (!i) {
      dp[i][1] = 20;
      dp[i][2] = 50;
      dp[i][3] = 120;
    } else {
      while (t[minute] <= t[i] - 90) minute++;
      while (t[day] <= t[i] - 1440) day++;
      dp[i][0] = min(dp[minute][2], dp[day][3]);
      dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + 20;
      dp[i][2] = min(dp[i - 1][0], dp[i - 1][1]) + 50;
      dp[i][3] = min(dp[i - 1][0], dp[i - 1][1]) + 120;
    }
    cout << min(dp[i][0], dp[i][1]) - min(dp[i - 1][0], dp[i - 1][1]) << endl;
  }
  return 0;
}
