#include <bits/stdc++.h>
using namespace std;
long long dp[100005];
long long a[1000005];
void solve(long long tc) {
  long long n;
  cin >> n;
  dp[0] = 0;
  a[0] = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    dp[i] = dp[i - 1] + 20;
    for (long long j = i - 1; j >= 1; j--) {
      if (a[i] > a[j] + 1440) break;
      if (a[i] <= a[j] + 89) {
        dp[i] = min(dp[i], dp[j - 1] + 50);
      }
      if (a[i] <= a[j] + 1439) {
        dp[i] = min(dp[i], dp[j - 1] + 120);
      }
    }
    cout << dp[i] - dp[i - 1] << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  long long t, x;
  t = 1;
  long long tc = 1;
  while (t--) {
    solve(tc);
    tc++;
  }
}
