#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
	string s1="hello";
	
	std::vector<std::pair<std::string, std::pair<int, double> > > chromosomes;
	chromosomes.emplace_back(s1, std::make_pair(12, 0.202));
	chromosomes.emplace_back("good", std::make_pair(11, 0.202));
	chromosomes.emplace_back("bye", std::make_pair(14, 0.202));
	chromosomes.emplace_back("yep", std::make_pair(11, 0.204));
	
	for (auto&x :chromosomes) 
	    cout <<x.first<<": "<<x.second.first<<" "<<x.second.second<<endl; 
    cout<<endl; 
	
	sort(chromosomes.begin(), chromosomes.end(),
	            [](auto &x, auto &y) { return x.second.first<y.second.first 
	                          || (x.second.first==y.second.first 
	                                 && x.second.second<y.second.second );});

	for (auto&x :chromosomes) 
	    cout <<x.first<<": "<<x.second.first<<" "<<x.second.second<<endl; 
	
	return 0;
}