#include <bits/stdc++.h>
using namespace std;
long long n, t, cash = 0, dp[100007];
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) dp[i] = 999999999999;
  for (int i = 1; i <= n; i++) {
    cin >> t;
    v.push_back(t);
    if (i == 1) {
      dp[i] = 20;
      cout << "20" << endl;
    } else {
      dp[i] = dp[i - 1] + 20;
      int it = upper_bound(v.begin(), v.end(), t - 90) - v.begin();
      dp[i] = min(dp[i - 1] + 20, dp[it] + 50);
      int ip = upper_bound(v.begin(), v.end(), t - 1440) - v.begin();
      dp[i] = min(dp[i], dp[ip] + 120);
      cout << dp[i] - dp[i - 1] << endl;
    }
  }
}
