#include <bits/stdc++.h>
using namespace std;
int dp[100005], n, in[100005];
int le90[100005], le1ha[100005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &in[i]);
  for (int i = 1; i <= n; i++) {
    int x = max(0, in[i] - 90 + 1);
    int l = 1, r = i, ans = 0;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (in[mid] < x)
        l = mid + 1;
      else if (in[mid] == x) {
        ans = mid;
        break;
      } else {
        ans = mid;
        r = mid - 1;
      }
    }
    le90[i] = ans;
  }
  for (int i = 1; i <= n; i++) {
    int x = max(0, in[i] - 1440 + 1);
    int l = 1, r = i, ans = 0;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (in[mid] < x)
        l = mid + 1;
      else if (in[mid] == x) {
        ans = mid;
        break;
      } else {
        ans = mid;
        r = mid - 1;
      }
    }
    le1ha[i] = ans;
  }
  for (int i = 1; i <= n; i++) {
    int ans = dp[i - 1] + 20, res = 20;
    int ans2 = dp[le90[i] - 1] + 50, res2 = ans2 - dp[i - 1];
    if (ans2 < ans) {
      ans = ans2;
      res = res2;
    }
    ans2 = dp[le1ha[i] - 1] + 120;
    res2 = ans2 - dp[i - 1];
    if (ans2 < ans) {
      ans = ans2;
      res = res2;
    }
    dp[i] = ans;
    printf("%d\n", res);
  }
  return 0;
}
