UVa 11616 - Roman Numerals

Summary
Converting from Integer to Roman and Roman to Integers.

Explanation
The input may be of two kinds. If the input is a Roman number then the output will be its equivalent int value. On the other hand if the input is an integer we have to produce the Roman number equivalent of the input.

Gotchas
Need to check what is the type of current input

Input
XXV 4 942 MCMLXXXIII

Output
25 IV CMXLII 1983