#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  int tmp = 0;
  int step = 0;
  for (int i = 0; i < n; i++) {
    int a;
    std::cin >> a;
    if (tmp <= a) {
      tmp = a;
      std::cout << "no" << std::endl;
    } else {
      step += tmp - a;
      std::cout << "need" << std::endl;
    }
  }
  std::cout << step << std::endl;
  return 0;
}
