In this task, you are given a date in a particular format and you need to convert to another format. If given format is "dd/mm/yyyy" then convert to "mm/dd/yyyy". If given format is "mm/dd/yyyy" then convert to "dd/mm/yyyy".

Example Input: 23/04/1789, input_format=dd/mm/yyyy
Example Output: 04/23/1789

Example Input: 03/26/1836, input_format=mm/dd/yyyy
Example Output: 26/03/1836

Example Input: 12/08/1857, input_format=mm/dd/yyyy
Example Output:
08/12/1857