#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ticket90, ticketDay;
  cin >> n;
  int trips[n], fare[n];
  fare[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> trips[i];
  }
  for (int i = 1; i <= n; i++) {
    fare[i] = fare[i - 1] + 20;
    ticket90 = upper_bound(trips, trips + n, trips[i] - 90) - trips;
    if (ticket90 > 0) ticket90--;
    ticketDay = upper_bound(trips, trips + n, trips[i] - 1440) - trips;
    if (ticketDay > 0) ticketDay--;
    fare[i] = min(fare[i], min((fare[ticket90] + 50), (fare[ticketDay] + 120)));
  }
  for (int i = 1; i <= n; i++) {
    cout << fare[i] - fare[i - 1] << endl;
  }
  return 0;
}
