#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
int main() {
  int n, a[MAX], b = 1, c = 1, ans[MAX], i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    while (a[i] - a[b] >= 90) b++;
    while (a[i] - a[c] >= 1440) c++;
    ans[i] = min(ans[i - 1] + 20, min(ans[b - 1] + 50, ans[c - 1] + 120));
    cout << ans[i] - ans[i - 1] << endl;
  }
  return 0;
}
