#include
#include
#include
#include
#include
using namespace std;
void print_message( const pair& message );
int main( )
{
list< pair< int, string > > message;
message.push_back( make_pair( 1, "A" ) );
message.push_back( make_pair( 2, "B" ) );
message.push_back( make_pair( 3, "C" ) );
message.push_back( make_pair( 4, "M" ) );
message.push_back( make_pair( 4, "M" ) );
message.push_back( make_pair( 4, "M" ) );
for_each( message.begin(), message.end(), print_message );
message.unique();
for_each( message.begin(), message.end(), print_message );
message.sort();
message.unique();
for_each( message.begin(), message.end(), print_message );
}
void print_message( const pair& message ){
cout << message.first << " - " << message.second << endl;
}