#include #include using namespace std; int main() { set s; int n; cin >> n; for(int i = 0; i < n; i++) { int x; cin >> x; s.insert(x); } int x; cin >> x; set::iterator it = s.lower_bound(x); if(it != s.end()) { cout << *it << endl; } else { cout << "NEMA TAKOV BROJ" << endl; } return 0; }