#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long mod = 1e9 + 7;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
bool is_vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return 1;
  return 0;
}
double getDistance(double x1, double y1, double x2, double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long extended_euclidean(long long a, long long b, long long &x,
                             long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long g = extended_euclidean(b, a % b, y, x);
  y -= (a / b) * x;
  return g;
}
long long power(long long base, long long p) {
  if (p == 1) return base;
  if (!p) return 1ll;
  long long ret = power(base, p / 2);
  ret *= ret;
  ret %= mod;
  if (p & 1) ret *= base;
  return ret % mod;
}
int dp[2][1445];
int a[100001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    scanf("%d", &a[i]);
  }
  a[0] = -10;
  int cur = 0;
  for (int j = (0); j <= (1440); ++j) dp[!cur][j] = 1e8;
  dp[1][0] = 0;
  int prv = 0;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (0); j <= (1440); ++j) dp[cur][j] = 1e8;
    for (int j = (0); j <= (1440); ++j) {
      if (dp[!cur][j] >= 1e8) continue;
      if (j >= a[i] - a[i - 1])
        dp[cur][j - a[i] + a[i - 1]] =
            min(dp[cur][j - a[i] + a[i - 1]], dp[!cur][j]);
      dp[cur][89] = min(dp[!cur][j] + 50, dp[cur][90 - 1]);
      dp[cur][1440 - 1] = min(dp[!cur][j] + 120, dp[cur][1440 - 1]);
      dp[cur][0] = min(dp[cur][0], dp[!cur][j] + 20);
    }
    int mn = i * 20LL;
    for (int j = (0); j <= (1440); ++j) {
      mn = min(dp[cur][j], mn);
    }
    cur = !cur;
    printf("%d\n", mn - prv);
    prv = mn;
  }
  return 0;
}
