#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int n;
int dp[MAXN + 10];
int t[MAXN + 10];
void call(int ind) {
  dp[ind] = 20 + dp[ind - 1];
  int j = lower_bound(t, t + ind, t[ind] - 89) - t;
  dp[ind] = min(dp[ind], 50 + dp[j - 1]);
  j = lower_bound(t, t + ind, t[ind] - 1439) - t;
  dp[ind] = min(dp[ind], 120 + dp[j - 1]);
}
int main() {
  int tot = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    call(i);
    int ans = dp[i] - tot;
    tot += ans;
    cout << ans;
    printf("\n");
  }
}
