# include <iostream>
using namespace std;
int main(){
int mn = 100000, mx = -100000, n;
cin >> n;
while(n--){
int x;
cin >> x;
mn = min(mn, x);
mx = max(mx, x);
}
cout << "MAX : " << mx << "\nMIN : " << mn;
# include <iostream>
using namespace std;
int main(){
int mn = 100000, mx = -100000, n;
cin >> n;
while(n--){
int x;
cin >> x;
mn = min(mn, x);
mx = max(mx, x);
}
cout << "MAX : " << mx << "\nMIN : " << mn;
}