#include <bits/stdc++.h>
using namespace std;
int main() {
  long long dp[100002][3];
  long long n, i, A[100002], x, last;
  cin >> n;
  dp[0][0] = 0;
  dp[0][1] = 0;
  dp[0][2] = 0;
  set<pair<long long, long long> > s;
  for (i = 1; i <= n; i++) {
    cin >> A[i];
  }
  for (i = 1; i <= n; i++) {
    s.insert(make_pair(A[i], i));
    dp[i][0] = min(min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + 20;
    auto it = s.lower_bound(make_pair(A[i] - 90, 1e9 + 1e9));
    if (it != s.begin()) {
      --it;
      x = it->second;
    } else
      x = 0;
    dp[i][1] = min(min(dp[x][0], dp[x][1]), dp[x][2]) + 50;
    auto it2 = s.lower_bound(make_pair(A[i] - 1440, 1e9 + 1e9));
    if (it2 != s.begin()) {
      --it2;
      x = it2->second;
    } else
      x = 0;
    dp[i][2] = min(min(dp[x][0], dp[x][1]), dp[x][2]) + 120;
  }
  last = 0;
  for (i = 1; i <= n; i++) {
    cout << min(min(dp[i][0], dp[i][1]), dp[i][2]) - last << endl;
    last = min(min(dp[i][0], dp[i][1]), dp[i][2]);
  }
  return 0;
}
