#include <bits/stdc++.h>
using namespace std;
long long t[111111];
long long dp[111111][3];
int main(void) {
  cin.tie(0);
  cin.sync_with_stdio(0);
  long long n;
  cin >> n;
  long long b = 0;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> t[i];
    long long j = i - 1;
    long long res1 = 1e9;
    for (long long k = 0; k < (long long)(3); k++) {
      if (j < 0) continue;
      res1 = min(res1, dp[j][k]);
    }
    while (j >= 0 && t[i] - t[j] < 90) j--;
    long long res2 = 1e9;
    for (long long k = 0; k < (long long)(3); k++) {
      if (j < 0) continue;
      res2 = min(res2, dp[j][k]);
    }
    while (j >= 0 && t[i] - t[j] < 1440) j--;
    long long res3 = 1e9;
    for (long long k = 0; k < (long long)(3); k++) {
      if (j < 0) continue;
      res3 = min(res3, dp[j][k]);
    }
    if (res1 == 1000000000) res1 = 0;
    if (res2 == 1000000000) res2 = 0;
    if (res3 == 1000000000) res3 = 0;
    dp[i][0] = res1 + 20;
    dp[i][1] = res2 + 50;
    dp[i][2] = res3 + 120;
    long long a = 1e9;
    for (long long j = 0; j < (long long)(3); j++) {
      a = min(a, dp[i][j]);
    }
    cout << a - b << '\n';
    b = a;
  }
  return 0;
}
