#include <iostream>
using namespace std;
int main() {
int a[100], n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
//сюда код свой
int min_elem_ind = 0;
int min_elem_val = a[0];
for (int i = 1; i < n; i++) {
if (min_elem_val > a[i]) {
min_elem_val = a[i];
min_elem_ind = i;
int max_elem_ind = 0;
int max_elem_val = a[0];
if (max_elem_val < a[i]) {
max_elem_val = a[i];
max_elem_ind = i;
if (max_elem_ind > min_elem_ind) {
cout << "Min" << endl;
if (max_elem_ind < min_elem_ind) {
cout << "Max" << endl;
else {
cout << "Error" << endl;
return 0;
#include <iostream>
using namespace std;
int main() {
int a[100], n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
//сюда код свой
int min_elem_ind = 0;
int min_elem_val = a[0];
for (int i = 1; i < n; i++) {
if (min_elem_val > a[i]) {
min_elem_val = a[i];
min_elem_ind = i;
}
}
int max_elem_ind = 0;
int max_elem_val = a[0];
for (int i = 1; i < n; i++) {
if (max_elem_val < a[i]) {
max_elem_val = a[i];
max_elem_ind = i;
}
}
if (max_elem_ind > min_elem_ind) {
cout << "Min" << endl;
}
if (max_elem_ind < min_elem_ind) {
cout << "Max" << endl;
}
else {
cout << "Error" << endl;
}
return 0;
}