#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  cin >> n;
  vector<long long> v;
  long long dp[n + 1];
  dp[0] = 0;
  for (long long i = 1; i < n + 1; i++) {
    long long t;
    cin >> t;
    dp[i] = dp[i - 1] + 20;
    int u = upper_bound(v.begin(), v.end(), t - 90) - v.begin();
    --u;
    dp[i] = min(dp[i], dp[u + 1] + 50);
    u = upper_bound(v.begin(), v.end(), t - 1440) - v.begin();
    --u;
    dp[i] = min(dp[i], dp[u + 1] + 120);
    v.push_back(t);
    cout << dp[i] - dp[i - 1] << endl;
  }
  return 0;
}
