#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> t(n);
  for (int i = 0; i < n; i++) cin >> t[i];
  vector<int> dp(n, 0);
  dp[0] = 20;
  int tm[3] = {0, 90, 1440};
  int cost[3] = {20, 50, 120};
  for (int i = 1; i < n; i++) {
    dp[i] = 20 + dp[i - 1];
    for (int j = 1; j < 3; j++) {
      int lower1 = t[i] - tm[j] + 1;
      if (lower1 <= t[0])
        dp[i] = min(dp[i], cost[j]);
      else {
        int idx = lower_bound(t.begin(), t.end(), lower1) - t.begin();
        idx--;
        if (idx >= 0) dp[i] = min(dp[i], dp[idx] + cost[j]);
      }
    }
  }
  cout << dp[0] << endl;
  for (int i = 1; i < n; i++) {
    cout << (dp[i] - dp[i - 1]) << endl;
  }
  return 0;
}
