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 | 24.08.2015
Geschäftsführer:
Bogumil, Carola, Köln, *12.09.1974
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

## Entry 2 | 23.08.2018
Bestellt als
Geschäftsführer:
Marques Felix, Filipe, Frechen, *06.07.1976
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

## Entry 3 | 07.03.2022
Nicht mehr
Geschäftsführer:
Bogumil, Carola, Köln, *12.09.1974
Nicht mehr
Geschäftsführer:
Marques Felix, Filipe, Frechen, *06.07.1976
Bestellt als
Geschäftsführer:
Gottschalk, Nicolas, Köln, *06.05.1991
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.
Bestellt als
Geschäftsführer:
Koch, Marius, Köln, *12.10.1992
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

## Entry 4 | 04.04.2022
Bestellt als
Geschäftsführer:
Thomas, Tom Vadakinathu, Köln, *16.02.1973
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

## Entry 6 | 06.06.2023
Nicht mehr
Geschäftsführer:
Gottschalk, Nicolas, Köln, *06.05.1991

## Entry 7 | 28.03.2024
Nicht mehr
Geschäftsführer:
Koch, Marius, Köln, *12.10.1992

## Entry 8 | 11.06.2024
Nicht mehr
Geschäftsführer:
Thomas, Tom Vadakinathu, Köln, *16.02.1973
Bestellt als
Geschäftsführer:
Sorgalla, Lukas Paul, Köln, *20.08.1995
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

## Entry 9 | 19.03.2026
Bestellt als
Geschäftsführer:
Stroman, Wilke, Köln, *04.01.1980
einzelvertretungsberechtigt mit der Befugnis im
Namen der Gesellschaft mit sich im eigenen
Namen oder als Vertreter eines Dritten
Rechtsgeschäfte abzuschließen.

