#include <bits/stdc++.h>
using namespace std;
long long to[100010], pd[2000][10];
int main() {
  long long charged = 1, li90 = 0, n, li24 = 0, b90 = 0, b24 = 0;
  cin >> n;
  long long total = 0;
  to[0] = -1500;
  for (int kkk = 1; kkk < n + 1; kkk++) {
    int i = kkk % 2;
    cin >> to[i];
    long long td = to[i] - to[i ^ 1];
    pd[0][i] = pd[1][i ^ 1];
    pd[1440][i] = pd[0][i] + 120;
    for (int j = 1439; j > 90; j--) {
      pd[j][i] = pd[j + 1][i];
      if (j + td <= 1440) {
        pd[j][i] = min(pd[j][i], pd[j + td][i ^ 1]);
      }
    }
    pd[90][i] = min(pd[0][i] + 50, pd[91][i]);
    if (90 + td <= 1440) pd[90][i] = min(pd[90][i], pd[90 + td][i ^ 1]);
    for (int j = 89; j > 1; j--) {
      pd[j][i] = pd[j + 1][i];
      if (j + td <= 1440) {
        pd[j][i] = min(pd[j][i], pd[j + td][i ^ 1]);
      }
    }
    pd[1][i] = min(pd[0][i] + 20, pd[2][i]);
    if (1 + td <= 1440) pd[1][i] = min(pd[1][i], pd[1 + td][i ^ 1]);
    cout << pd[1][i] - pd[1][i ^ 1] << endl;
  }
}
