You extract role timelines from German Handelsregister CD text.

Return valid JSON only. No markdown. No explanations.

Output schema:
{
  "roles": [
    {
      "name": "string or null",
      "titles": ["string"],
      "birth_date": "DD.MM.YYYY or null",
      "city": "string or null",
      "role": "string",
      "start_date": "DD.MM.YYYY or null",
      "end_date": "DD.MM.YYYY or null",
      "initial_marker": true
    }
  ]
}

Task:
Build a clean timeline of people and their company roles from the CD entries.

Use these ideas:
- Each entry has a date in the heading. Use it as the event date.
- A role object represents one continuous period in one role.
- Do not copy every entry into a new object.
- First read the whole entry, then decide whether it is an appointment, a removal, or only an update.

Appointments and removals:
- If a person is appointed or appears as an active role holder, create or keep an active role with start_date = entry date and end_date = null.
- If a person no longer holds a role, set end_date = entry date for the matching active role.
- If the same person is appointed, removed, and later appointed again, create a separate role object for the later appointment.

Updates:
- Entries about changed personal data, name, city, residence, representation authority, or legal authority are updates, not new appointments.
- For update entries, update the existing active role object. Do not create a new role object. Do not change start_date or end_date.
- Match people mainly by birth_date. If birth_date is the same, it is the same person even if the name or city changed.
- Keep the newest known name and city in the final object.
- If an update entry mentions a person but there is no matching active role before it, do not create a new role object from that update alone.

Liquidator:
- Liquidator is a real role.
- If an active Geschäftsführer or Vorstand becomes Liquidator, end the old role at that entry date and create a new Liquidator role starting at the same entry date.
- Keep Liquidator active with end_date = null unless the input later says the person is no longer Liquidator.

Fields:
- Keep names in the same order as the source. Do not convert "Last, First" to "First Last".
- Put academic or professional titles in titles, not in name.
- Remove city, birth date, role labels, and representation text from name.
- Unknown values must be null. Empty titles must be [].
- initial_marker is true if the person is already active in the first input entry (## Entry 1). Otherwise it is false.

Example input:
## Entry 1 | 10.01.2001
Geschäftsführer:
Dr. Sommer, Lena, Köln, *12.03.1975
einzelvertretungsberechtigt.
Geschäftsführer:
Brandt, Felix, München, *04.05.1968

## Entry 4 | 20.06.2005
Nicht mehr
Geschäftsführer:
Dr. Sommer, Lena, Köln, *12.03.1975
Bestellt:
Geschäftsführer:
Keller, Martin, Bonn, *01.02.1970

Example output:
{
  "roles": [
    {
      "name": "Sommer, Lena",
      "titles": ["Dr."],
      "birth_date": "12.03.1975",
      "city": "Köln",
      "role": "Geschäftsführer",
      "start_date": "10.01.2001",
      "end_date": "20.06.2005",
      "initial_marker": true
    },
    {
      "name": "Brandt, Felix",
      "titles": [],
      "birth_date": "04.05.1968",
      "city": "München",
      "role": "Geschäftsführer",
      "start_date": "10.01.2001",
      "end_date": null,
      "initial_marker": true
    },
    {
      "name": "Keller, Martin",
      "titles": [],
      "birth_date": "01.02.1970",
      "city": "Bonn",
      "role": "Geschäftsführer",
      "start_date": "20.06.2005",
      "end_date": null,
      "initial_marker": false
    }
  ]
}

Example input:
## Entry 2 | 05.02.2010
Bestellt:
Geschäftsführer:
Fischer, Laura, Bonn, *18.10.1983

## Entry 3 | 20.11.2015
Personenbezogene Daten geändert, nun:
Geschäftsführer:
Fischer, Laura Maria, Essen, *18.10.1983
mit der Befugnis im Namen der Gesellschaft mit
sich im eigenen Namen oder als Vertreter eines
Dritten Rechtsgeschäfte abzuschließen.

Example output:
{
  "roles": [
    {
      "name": "Fischer, Laura Maria",
      "titles": [],
      "birth_date": "18.10.1983",
      "city": "Essen",
      "role": "Geschäftsführer",
      "start_date": "05.02.2010",
      "end_date": null,
      "initial_marker": false
    }
  ]
}

Example input:
## Entry 7 | 03.04.2012
War Vorstand:
Prof. Dr. Weber, Clara, Hamburg, *20.09.1960
Bestellt als
Vorstand:
Dipl.-Kfm. Neumann, Thomas, Essen, *11.11.1977

Example output:
{
  "roles": [
    {
      "name": "Weber, Clara",
      "titles": ["Prof. Dr."],
      "birth_date": "20.09.1960",
      "city": "Hamburg",
      "role": "Vorstand",
      "start_date": null,
      "end_date": "03.04.2012",
      "initial_marker": true
    },
    {
      "name": "Neumann, Thomas",
      "titles": ["Dipl.-Kfm."],
      "birth_date": "11.11.1977",
      "city": "Essen",
      "role": "Vorstand",
      "start_date": "03.04.2012",
      "end_date": null,
      "initial_marker": false
    }
  ]
}

Example input:
## Entry 2 | 12.05.2006
Bestellt:
Geschäftsführer:
Schmidt, Peter, Essen, *10.10.1965

## Entry 9 | 30.08.2014
Nicht mehr Geschäftsführer, nunmehr
Liquidator:
Schmidt, Peter, Essen, *10.10.1965

Example output:
{
  "roles": [
    {
      "name": "Schmidt, Peter",
      "titles": [],
      "birth_date": "10.10.1965",
      "city": "Essen",
      "role": "Geschäftsführer",
      "start_date": "12.05.2006",
      "end_date": "30.08.2014",
      "initial_marker": false
    },
    {
      "name": "Schmidt, Peter",
      "titles": [],
      "birth_date": "10.10.1965",
      "city": "Essen",
      "role": "Liquidator",
      "start_date": "30.08.2014",
      "end_date": null,
      "initial_marker": false
    }
  ]
}

Now extract roles from this input:

## Entry 1 | 18.03.2013
Geschäftsführer:
1.
März, Marco, *22.08.1978, Berlin
mit der Befugnis die Gesellschaft
allein zu vertreten
mit der Befugnis Rechtsgeschäfte
mit sich selbst oder als Vertreter
Dritter abzuschließen
Vorstand, Leitungsorgan, ge-
schäftsführende Direktoren,
persönlich haftende Gesell-
schafter, Geschäftsführer,
Vertretungsberechtigte und
besondere Vertretungsbefug-
nis

## Entry 2 | 04.11.2014
Nicht mehr Geschäftsführer:
1. März, Marco
Geschäftsführer:
2.
März, Sandra, *30.06.1979, Berlin
mit der Befugnis die Gesellschaft
allein zu vertreten
mit der Befugnis Rechtsgeschäfte
mit sich selbst oder als Vertreter
Dritter abzuschließen

## Entry 4 | 29.01.2018
Vorstand, Leitungsorgan, ge-
schäftsführende Direktoren,
persönlich haftende Gesell-
schafter, Geschäftsführer,
Vertretungsberechtigte und
besondere Vertretungsbefug-
nis

## Entry 5 | 13.03.2020
Nicht mehr Geschäftsführer:
2. März, Sandra
Geschäftsführer:
3.
Doering, Marcel Andres,
*13.07.1993, Ulm
mit der Befugnis die Gesellschaft
allein zu vertreten
mit der Befugnis Rechtsgeschäfte
mit sich selbst oder als Vertreter
Dritter abzuschließen

## Entry 6 | 10.09.2021
Vorstand, Leitungsorgan, ge-
schäftsführende Direktoren,
persönlich haftende Gesell-
schafter, Geschäftsführer,
Vertretungsberechtigte und
besondere Vertretungsbefug-
nis

## Entry 7 | 22.08.2024
Die Eintragung zu Nr. 3:
Geschäftsführer:
Doering, Marcel Andres
ist mangels einer wesentlichen
Voraussetzung gemäß § 395
FamFG von Amts wegen gelöscht.

## Entry 8 | 19.02.2026
Vorstand, Leitungsorgan, ge-
schäftsführende Direktoren,
persönlich haftende Gesell-
schafter, Geschäftsführer,
Vertretungsberechtigte und
besondere Vertretungsbefug-
nis

