#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> mp;
map<long long int, long long int>::iterator it;
long long int n, i, a[100005], ans[100005], k, sum[100005];
int main() {
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]] = i;
    ans[i] = 20;
    if (mp.find(a[i] - 89) != mp.end()) {
      it = mp.find(a[i] - 89);
      if (it->second != i)
        ans[i] = min(ans[i], 50 + sum[it->second] - k - ans[it->second]);
    } else {
      mp[a[i] - 89] = 0;
      it = mp.find(a[i] - 89);
      it++;
      if (it->second != i)
        ans[i] = min(ans[i], 50 + sum[it->second] - k - ans[it->second]);
      mp.erase(a[i] - 89);
    }
    if (mp.find(a[i] - 1439) != mp.end()) {
      it = mp.find(a[i] - 1439);
      if (it->second != i)
        ans[i] = min(ans[i], 120 + sum[it->second] - k - ans[it->second]);
    } else {
      mp[a[i] - 1439] = 0;
      it = mp.find(a[i] - 1439);
      it++;
      if (it->second != i)
        ans[i] = min(ans[i], 120 + sum[it->second] - k - ans[it->second]);
      mp.erase(a[i] - 1439);
    }
    cout << ans[i] << endl;
    if (i)
      sum[i] = sum[i - 1] + ans[i];
    else
      sum[i] = ans[i];
    k = sum[i];
  }
  return 0;
}
