#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int OO = 1e9;
int n;
int t[N + 2];
int dp[N + 2];
char sdp[N + 2];
int DP(int i) {
  if (sdp[i]) return dp[i];
  if (i <= 0) return 0;
  int ret = OO;
  ret = min(ret, DP(i - 1) + 20);
  int j;
  j = lower_bound(t, t + i - 1, t[i - 1] + 1 - 90) - t;
  ret = min(ret, DP(j) + 50);
  j = lower_bound(t, t + i - 1, t[i - 1] + 1 - 1440) - t;
  ret = min(ret, DP(j) + 120);
  sdp[i] = 1;
  dp[i] = ret;
  return ret;
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> t[i];
  }
  t[n] = t[n - 1] + 1;
  for (int(i) = (0); (i) < (n); (i)++) {
    cout << DP(i + 1) - DP(i) << endl;
  }
  return 0;
}
