#include <bits/stdc++.h>
using namespace std;
long long const INF = 2147483647, R_INF = 9223372036854775807, MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cerr.tie(NULL);
  int n;
  cin >> n;
  vector<int> v;
  vector<int> DP(n + 1, 0);
  for (long long i = (1); i < (n + 1); i++) {
    v.emplace_back();
    cin >> v[i - 1];
    DP[i] = min(
        {DP[i - 1] + 20,
         DP[upper_bound(v.begin(), v.end(), v[i - 1] - 90) - v.begin()] + 50,
         DP[upper_bound(v.begin(), v.end(), v[i - 1] - 1440) - v.begin()] +
             120});
    cout << DP[i] - DP[i - 1] << endl;
  }
}
