#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << endl;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << endl;
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
int n;
const int MAX = 1e6 + 7;
long long dp[MAX];
vector<long long> t;
const long long inf = 1e15;
int get_pos(int timee, int i) {
  int pos = upper_bound(t.begin(), t.end(), timee) - t.begin();
  pos--;
  return pos;
}
void func() {
  for (int i = 1; i <= n; i++) {
    dp[i] = dp[i - 1] + 20;
    long long t90 = t[i] - 90;
    long long t1440 = t[i] - 1440;
    int pos1 = get_pos(t90, i);
    int pos2 = get_pos(t1440, i);
    long long cost1 = (pos1 < 0) ? 50 : dp[pos1] + 50;
    long long cost2 = (pos2 < 0) ? 120 : dp[pos2] + 120;
    dp[i] = min(dp[i], min(cost1, cost2));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  t.push_back(0);
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    t.push_back(x);
  }
  func();
  for (int i = 1; i <= n; i++) cout << dp[i] - dp[i - 1] << endl;
  return 0;
}
