#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> t(n, 999999999), dp(n + 1);
  dp[0] = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> t[i - 1];
    dp[i] = min(
        {dp[i - 1] + 20,
         dp[lower_bound(t.begin(), t.end(), t[i - 1] - 89) - t.begin()] + 50,
         dp[lower_bound(t.begin(), t.end(), t[i - 1] - 1439) - t.begin()] +
             120});
    cout << dp[i] - dp[i - 1] << endl;
  }
}
