#include <iostream>
using std::cerr;
using std::cout;
using std::endl;
using std::cin;
#include <list>
using std::list;
#include "Person14.h"
#include "Date14.h"
bool getrecord(string& nbuf, string& fbuf, int& y, int& m, int& d)
{
char sep;
return (cin >> nbuf >> fbuf >> y >> sep >> m >> sep >> d);
}
int main() {
string nbuf;
string fbuf;
int y, m, d;
list<Person *> persons;
Person* p;
Date silvester(31, 12);
list<Person *>::iterator it;
while ( getrecord(nbuf, fbuf, y, m, d) ) {
p = new Person(nbuf, fbuf, d, m, y);
for ( it = persons.begin(); it != persons.end(); ++it) {
if (*p <= **it) break;
}
persons.insert(it, p);
}
for ( it = persons.begin(); it != persons.end(); ++it) {
p = *it;
cout << p->lastName() << ' ' << p->firstName() << ' ' <<
p->birthday() << ", Alter: " << silvester - p->birthday() <<
" Tage" << endl;
delete p;
}
return 0;
}