Resistor Colour Code
A 4-band resistor's first three bands give two digits and a multiplier: black 0, brown 1, red 2, orange 3, yellow 4, green 5, blue 6, violet 7, grey 8, white 9. Value .
Print the value as X ohms below 1000, Xk ohms from 1000 up to 999999, and XM ohms from — where X has no trailing zeros (e.g. 4.7k ohms, 22k ohms, 1M ohms).
Input
Three colour names (lowercase).
Output
The value.
Constraints
The multiplier band is between black and blue.
Sample 1
Input
red red brown
Output
220 ohms
Sample 2
Input
yellow violet red
Output
4.7k ohms