#include <bits/stdc++.h>
using namespace std;
const int N = 200100, INF = 2009000999;
const long long MOD = 1000 * 1000 * 1000 + 7;
long long a[N], opt[N];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int l90 = 0, l1440 = 0;
  cin >> a[0];
  opt[0] = 20;
  cout << 20 << endl;
  for (int i = 1; i < n; i++) {
    cin >> a[i];
    while (a[i] - a[l90] >= 90) l90++;
    while (a[i] - a[l1440] >= 1440) l1440++;
    long long cur_opt = opt[i - 1] + 20;
    if (l90 > 0)
      cur_opt = min(cur_opt, opt[l90 - 1] + 50);
    else
      cur_opt = min(cur_opt, 50ll);
    if (l1440 > 0)
      cur_opt = min(cur_opt, opt[l1440 - 1] + 120);
    else
      cur_opt = min(cur_opt, 120ll);
    opt[i] = cur_opt;
    cout << cur_opt - opt[i - 1] << endl;
  }
  return 0;
}
