#include <bits/stdc++.h>
template <class Class>
void Print(Class instance) {
  std::cout << instance << std::endl;
}
void Print() { std::cout << std::endl; }
int main() {
  std::ios_base::sync_with_stdio(false);
  size_t n;
  std::cin >> n;
  std::vector<int> time(n + 1);
  std::vector<int> paid(n + 1);
  size_t hour_pointer = 0;
  size_t day_pointer = 0;
  int hour_paid = 0;
  int day_paid = 0;
  for (size_t index = 1; index < n + 1; ++index) {
    std::cin >> time[index];
    while (time[hour_pointer] + 90 <= time[index]) {
      hour_paid -= paid[hour_pointer];
      ++hour_pointer;
    }
    while (time[day_pointer] + 1440 <= time[index]) {
      day_paid -= paid[day_pointer];
      ++day_pointer;
    }
    paid[index] = std::min({20, 50 - hour_paid, 120 - day_paid});
    hour_paid += paid[index];
    day_paid += paid[index];
    Print(paid[index]);
  }
  return 0;
}
