#include <iostream>
#include <algorithm>

int main() {
	int a[] = {2, 1, 2, 3, 4};
	std::nth_element(a, a+2, a+5);
	std::cout << a[1];
	return 0;
}