#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 6;
int n, t[MX];
int ID(int x, int jump) {
  int st = 1, en = x, ret = 1e6;
  while (st <= en) {
    int mid = (st + en) / 2;
    if (t[x] - jump <= t[mid]) {
      ret = min(ret, mid);
      en = mid - 1;
    } else
      st = mid + 1;
  }
  return ret;
}
int dp[MX];
int solve(int x) {
  if (x < 1) return 0;
  if (dp[x] != -1) return dp[x];
  int ans = 1e8;
  int id = ID(x, 1439);
  if (id < x) ans = min(ans, 120 + solve(id - 1));
  id = ID(x, 89);
  if (id < x) ans = min(ans, 50 + solve(id - 1));
  ans = min(ans, 20 + solve(x - 1));
  return dp[x] = ans;
}
int main() {
  cin >> n;
  memset(dp, -1, sizeof dp);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", t + i);
    cout << solve(i) - ans << endl;
    ans = solve(i);
  }
  return 0;
}
