#include <bits/stdc++.h>
using namespace std;
const int N = 400000;
const int MOD = 1e9 + 7;
long long dp[N], t[N], n, i1 = 1, i2 = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    while (t[i1] + 90 <= t[i]) i1++;
    while (t[i2] + 1440 <= t[i]) i2++;
    dp[i] = dp[i - 1] + 20;
    dp[i] = min(dp[i], dp[i1 - 1] + 50);
    dp[i] = min(dp[i], dp[i2 - 1] + 120);
    cout << dp[i] - dp[i - 1] << endl;
  }
  return 0;
}
