#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> times(n + 1, 0);
  for (int i = 1; i <= n; i++) scanf("%d", &times[i]);
  vector<long long> dp(n + 1, 0);
  map<long long, int> ss, sl;
  int ptrs = 1;
  int ptrl = 1;
  dp[1] = (long long)20;
  ss[dp[1]] = 1;
  sl[dp[1]] = 1;
  for (int i = 2; i <= n; i++) {
    while (ptrs < i) {
      if (times[ptrs] < times[i] - 90 + 1) {
        if (ss[dp[ptrs]] == 1)
          ss.erase(dp[ptrs]);
        else
          ss[dp[ptrs]]--;
        ptrs++;
      } else
        break;
    }
    while (ptrl < i) {
      if (times[ptrl] < times[i] - 1440 + 1) {
        if (sl[dp[ptrl]] == 1)
          sl.erase(dp[ptrl]);
        else
          sl[dp[ptrl]]--;
        ptrl++;
      } else
        break;
    }
    dp[i] = dp[i - 1] + 20;
    if (!ss.empty()) {
      auto it = ss.begin();
      dp[i] = min(dp[i], it->first + (long long)50);
    }
    if (!sl.empty()) {
      auto it = sl.begin();
      dp[i] = min(dp[i], it->first + (long long)120);
    }
    dp[i] = min(dp[i], (long long)50 + dp[ptrs - 1]);
    dp[i] = min(dp[i], (long long)120 + dp[ptrl - 1]);
    if (ss.count(dp[i]))
      ss[dp[i]]++;
    else
      ss[dp[i]] = 1;
    if (sl.count(dp[i]))
      sl[dp[i]]++;
    else
      sl[dp[i]] = 1;
  }
  printf("%lld\n", dp[1]);
  for (int i = 2; i <= n; i++) printf("%lld\n", dp[i] - dp[i - 1]);
  return 0;
}
