#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 5;
long long int arr[maxn], dp[maxn];
long long int go(long long int curr, long long int low, long long int high) {
  long long int mid, ret = 0;
  curr = max((long long int)0, curr);
  while (low <= high) {
    mid = (low + high) / 2;
    if (arr[mid] >= curr) {
      ret = mid;
      high = mid - 1;
    } else {
      low = mid + 1;
    }
  }
  return ret;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> arr[i];
    dp[i] = dp[i - 1] + 20;
    long long int curr = arr[i] - 90 + 1;
    curr = go(curr, 0, i);
    if (curr > 0) curr--;
    dp[i] = min(dp[i], dp[curr] + 50);
    curr = arr[i] - 1440 + 1;
    curr = go(curr, 0, i);
    if (curr > 0) curr--;
    dp[i] = min(dp[i], dp[curr] + 120);
    cout << dp[i] - dp[i - 1] << endl;
  }
  return 0;
}
