#include <bits/stdc++.h>
using namespace std;
const int n_ = 1e5 + 10;
int dp[n_], t[n_];
int n;
int main() {
  scanf("%d", &n);
  int s90 = 1, s1440 = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    while (t[s90] <= t[i] - 90) s90++;
    while (t[s1440] <= t[i] - 1440) s1440++;
    dp[i] = min(dp[i - 1] + 20, min(dp[s90 - 1] + 50, dp[s1440 - 1] + 120));
    printf("%d\n", dp[i] - dp[i - 1]);
  }
  return 0;
}
