#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t[n + 1], fsol[n + 1], dx = 1, hx = 1;
  t[0] = 0;
  fsol[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    while (t[hx] + 90 <= t[i]) hx++;
    while (t[dx] + 1440 <= t[i]) dx++;
    fsol[i] = min(fsol[i - 1] + 20, min(fsol[hx - 1] + 50, fsol[dx - 1] + 120));
    cout << fsol[i] - fsol[i - 1] << endl;
  }
  return 0;
}
