#include <iostream>
#include <algorithm>
#include <climits>

using namespace std;

int main() {
	int numbers[] = { 2, 3, 1, 4, 5, 6, 4, 3, 5, 7 };
	int min_number = INT_MAX, max_number = INT_MIN;
    for_each(begin(numbers), end(numbers),
    	[&min_number, &max_number](int n) {
        	min_number = min(min_number, n);
            max_number = max(max_number, n);
        });
	cout << "MAX: " << max_number << "\nMIN: " << min_number << endl;
	return 0;
}