<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def int2roman(val):
 """Code roman number :param val: integer between 1 and 9999 :returns: the corresponding roman number :complexity: linear (if that makes sense for constant bounded input size) """

    s = ''
    pos10 = 1000
    for pos in range(3, -1, -1):
        digit = val // pos10
        s += roman[pos][digit]
        val %= pos10
        pos10 //= 10
    return s