#include <bits/stdc++.h>
using namespace std;
int dp[100010];
int arr[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    int m = arr[i];
    dp[i] = dp[i - 1] + 20;
    int key = max(0, m - 90 + 1);
    int low = 0;
    int high = i;
    int ans = 0;
    int mid;
    while (low <= high) {
      mid = (low + high) >> 1;
      if (arr[mid] >= key) {
        high = mid - 1;
        ans = mid;
      } else {
        low = mid + 1;
      }
    }
    if (ans > 0) ans--;
    dp[i] = min(dp[i], dp[ans] + 50);
    key = max(0, m - 1440 + 1);
    low = 0;
    high = i;
    ans = 0;
    while (low <= high) {
      mid = (low + high) >> 1;
      if (arr[mid] >= key) {
        high = mid - 1;
        ans = mid;
      } else {
        low = mid + 1;
      }
    }
    if (ans > 0) ans--;
    dp[i] = min(dp[i], dp[ans] + 120);
    printf("%d\n", dp[i] - dp[i - 1]);
  }
  return 0;
}
