#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  long n;
  std::cin >> n;
  std::vector<long> t(n);
  for (long i = 0; i != n; ++i) std::cin >> t[i];
  std::vector<long> cost(n + 1, 0);
  for (long i = 1; i <= n; ++i) {
    cost[i] = cost[i - 1] + 20;
    const long p1 =
        std::lower_bound(t.begin(), t.begin() + i - 1, t[i - 1] - 90 + 1) -
        t.begin();
    const long p2 =
        std::lower_bound(t.begin(), t.begin() + i - 1, t[i - 1] - 1440 + 1) -
        t.begin();
    cost[i] = std::min(cost[i], cost[p1] + 50);
    cost[i] = std::min(cost[i], cost[p2] + 120);
  }
  long sum = 0;
  for (long i = 1; i <= n; ++i) {
    std::cout << cost[i] - sum << "\n";
    sum += cost[i] - sum;
  }
  return 0;
}
