#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, t[maxn];
int dp[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &t[i]);
  dp[1] = 20;
  set<pair<int, int> > s;
  s.insert(pair<int, int>(t[1], 1));
  for (int i = 2; i <= n; ++i) {
    dp[i] = dp[i - 1] + 20;
    set<pair<int, int> >::iterator it =
        s.lower_bound(pair<int, int>(t[i] - 90 + 1, -1));
    if (it != s.end()) dp[i] = min(dp[i], dp[it->second - 1] + 50);
    it = s.lower_bound(pair<int, int>(t[i] - 1440 + 1, -1));
    if (it != s.end()) dp[i] = min(dp[i], dp[it->second - 1] + 120);
    s.insert(pair<int, int>(t[i], i));
  }
  for (int i = 1; i <= n; ++i) printf("%d\n", dp[i] - dp[i - 1]);
  return 0;
}
