






from __future__ import annotations

from typing import Any







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	None:
     create_state_space_tree(__lowerCAmelCase					,    []					,    0			)







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase					,    __lowerCAmelCase					,    __lowerCAmelCase			) ->	None:

     if index == len(__lowerCAmelCase			):
          print(__lowerCAmelCase			)
          return

     create_state_space_tree(__lowerCAmelCase					,    __lowerCAmelCase					,    index + 1			)
     current_subsequence.append(sequence[index]			)
     create_state_space_tree(__lowerCAmelCase					,    __lowerCAmelCase					,    index + 1			)
     current_subsequence.pop()


if __name__ == "__main__":
 lowerCamelCase	:							list[Any]				=[3, 1, 2, 4]
 generate_all_subsequences(seq)

 seq.clear()
 seq.extend(['''A''', '''B''', '''C'''])
 generate_all_subsequences(seq)







lowerCamelCase	:							List[Any]				=[
    (1000, '''M'''),
    (900, '''CM'''),
    (500, '''D'''),
    (400, '''CD'''),
    (100, '''C'''),
    (90, '''XC'''),
    (50, '''L'''),
    (40, '''XL'''),
    (10, '''X'''),
    (9, '''IX'''),
    (5, '''V'''),
    (4, '''IV'''),
    (1, '''I'''),
]







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	int:
     UpperCamelCase__			:   Optional[int]       				=  {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
     UpperCamelCase__			:   Any       				=  0
     UpperCamelCase__			:   Any       				=  0
     while place < len(__lowerCAmelCase			):
          if (place + 1 < len(__lowerCAmelCase			)) and (vals[roman[place]] < vals[roman[place + 1]]):
               total += vals[roman[place + 1]] - vals[roman[place]]
               place += 2
          else:
               total += vals[roman[place]]
               place += 1
     return total







def 		SCREAMING_SNAKE_CASE							(					__lowerCAmelCase			) ->	str:
     UpperCamelCase__			:   Optional[int]       				=  []
     for arabic, roman in ROMAN:
          ((UpperCamelCase__)				,     (UpperCamelCase__))			:   Optional[int]       				=  divmod(__lowerCAmelCase					,    __lowerCAmelCase			)
          result.append(roman * factor			)
          if number == 0:
               break
     return "".join(__lowerCAmelCase			)


if __name__ == "__main__":
 import doctest

 doctest.testmod()