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: 06/02/1897, input_format=mm/dd/yyyy
Example Output: 02/06/1897

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

Example Input: 08/05/1922, input_format=mm/dd/yyyy
Example Output:
05/08/1922