#include <bits/stdc++.h>
using namespace std;
const int G = 1000 * 100 + 10;
long long a[G];
long long s[G];
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> a[i];
  }
  a[0] = -1;
  s[1] = 20;
  for (int i = 1; i <= t; i++) {
    bool f = 0;
    int r = a[i] - 1440;
    long long j = max(r, -1);
    int y = upper_bound(a, a + t + 1, j) - a;
    if (s[i - 1] - s[y - 1] >= 120 && y < i) {
      cout << 0 << endl;
      s[i] = 120 + s[y - 1];
    } else {
      if (s[i - 1] - s[y - 1] >= 110 && y < i) {
        f = 1;
      }
      int r = a[i] - 90;
      long long jj = max(r, -1);
      int yy = upper_bound(a, a + t + 1, jj) - a;
      if (s[i - 1] - s[yy - 1] >= 40 && yy < i) {
        cout << 50 - (s[i - 1] - s[yy - 1]) << endl;
        s[i] = 50 + s[yy - 1];
      } else if (f == 1) {
        s[i] = s[i - 1] + 10;
        cout << 10 << endl;
      } else {
        cout << 20 << endl;
        s[i] = s[i - 1] + 20;
      }
    }
  }
  return 0;
}
