#include <bits/stdc++.h>
const long long int mrx = 1e6 + 5, M = 1e9 + 7;
long long int mx = -1e18 - 1, mn = 1e18 + 1;
using namespace std;
vector<long long int> a;
long long int b, x, d[mrx];
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cin >> b;
  for (int i = 1; i <= b; i++) {
    cin >> x;
    d[i] = d[i - 1] + 20;
    if (i == 1 || a[0] > x - 90 + 1) {
      d[i] = min(50ll, d[i]);
    } else {
      long long int it =
          lower_bound(a.begin(), a.end(), x - 90 + 1) - a.begin();
      d[i] = min(d[it] + 50ll, d[i]);
    }
    if (i == 1 || a[0] > x - 1440 + 1) {
      d[i] = min(120ll, d[i]);
    } else {
      long long int it =
          lower_bound(a.begin(), a.end(), x - 1440 + 1) - a.begin();
      d[i] = min(d[it] + 120ll, d[i]);
    }
    a.push_back(x);
  }
  for (int i = 1; i <= b; i++) {
    cout << d[i] - d[i - 1] << "\n";
  }
  return 0;
}
