/**
 * Given a map containing information about a police officer, update the officer's details with the latest information.
 *
 * @param officerInfo A map containing the following keys: 'name', 'badge_id', 'department', and 'rank'. Each key holds the corresponding value.
 * @return An updated map where each key-value pair in the original officerInfo has been updated with the latest information.
 */
fun upgradePoliceOfficer(officerInfo: MutableMap<String, String>): MutableMap<String, String> {

    // Retrieving the latest information and updating the officer's details
    officerInfo["name"] = readLine()!!
    officerInfo["badge_id"] = readLine()!!
    officerInfo["department"] = readLine()!!
    officerInfo["rank"] = readLine()!!

    return officerInfo
}

// Example usage
/**
 * Given a map containing information about a police officer, update the officer's details with the latest information.
 *
 * @param officerInfo A map containing the following keys: 'name', 'badge_id', 'department', and 'rank'. Each key holds the corresponding value.
 * @return An updated map where each key-value pair in the original officerInfo has been updated with the latest information.
 */
fun upgradePoliceOfficer(officerInfo: MutableMap<String, String>): MutableMap<String, String> {
/**
 * Given a map containing information about a police officer, update the officer's details with the latest information.
 *
 * @param officerInfo A map containing the following keys: 'name', 'badge_id', 'department', and 'rank'. Each key holds the corresponding value.
 * @return An updated map where each key-value pair in the original officerInfo has been updated with the latest information.
 */
fun upgradePoliceOfficer(officerInfo: MutableMap<String, String>): MutableMap<String, String> {

    // Retrieving the latest information and updating the officer's details
    officerInfo["name"] = readLine()!!
    officerInfo["badge_id"] = readLine()!!
    officerInfo["department"] = readLine()!!
    officerInfo["rank"] = readLine()!!

    return officerInfo
}

// Example usage