#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v, dp(n + 3, 1e18);
  v.push_back(-1520);
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  dp[0] = 0, dp[1] = 20;
  for (int i = 2; i <= n; i++) {
    dp[i] = min(dp[i], dp[i - 1] + 20);
    if (v[i] - v[i - 1] + 1 <= 90) {
      int p = lower_bound(v.begin(), v.end(), v[i] - 90 + 1) - v.begin();
      dp[i] = min(dp[i], dp[p - 1] + 50);
    }
    if (v[i] - v[i - 1] + 1 <= 1440) {
      int p = lower_bound(v.begin(), v.end(), v[i] - 1440 + 1) - v.begin();
      dp[i] = min(dp[i], dp[p - 1] + 120);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << dp[i] - dp[i - 1] << '\n';
  }
  return 0;
}
