#include <bits/stdc++.h>
using namespace std;
long long int a[100010], dp[1000010];
long long int find(long long int l, long long int r, long long int x) {
  x = max(0ll, x);
  long long int ans = 0;
  while (l <= r) {
    long long int mid = (l + r) / 2;
    if (a[mid] < x) {
      l = mid + 1;
    } else {
      ans = mid;
      r = mid - 1;
    }
  }
  return ans;
}
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> a[i];
  for (long long int i = 1; i <= n; i++) {
    long long int temp = dp[i - 1] + 20;
    long long int temp1, temp2;
    long long int index = find(0, i, a[i] - 90 + 1);
    if (index > 0) index--;
    temp1 = dp[index] + 50;
    long long int index1 = find(0, i, a[i] - 1440 + 1);
    if (index1 > 0) index1--;
    temp2 = dp[index1] + 120;
    dp[i] = min(temp, min(temp1, temp2));
    cout << dp[i] - dp[i - 1] << endl;
  }
  return 0;
}
