#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int n;
set<pair<long long, int> > s;
long long dp[MAXN], t;
int main() {
  scanf("%d", &n);
  s.insert(make_pair(MAXN, MAXN - 1));
  for (int i = (0); i < int(n); i++) {
    scanf("%lld", &t);
    if (!i) {
      dp[i] = 20;
      puts("20");
      s.insert(make_pair(-t, i));
      continue;
    }
    dp[i] = dp[i - 1] + 20;
    set<pair<long long, int> >::iterator it =
        s.upper_bound(make_pair(-t + 90, -i));
    dp[i] = min(dp[i], dp[it->second] + 50);
    it = s.upper_bound(make_pair(-t + 1440, -i));
    dp[i] = min(dp[i], dp[it->second] + 120);
    s.insert(make_pair(-t, i));
    if (t < 90) dp[i] = min(dp[i], 50LL);
    if (t < 1440) dp[i] = min(dp[i], 120LL);
    printf("%lld\n", dp[i] - dp[i - 1]);
  }
  return 0;
}
