def canvia_format(s):
    if 'PM' not in s and 'AM' not in s:
        pos_dospunts = s.find(':')
        hora = s[:pos_dospunts]
        minuts = s[pos_dospunts:]
        if int(hora)<12:
            s2 = s + ' matí'
        else:
            s2 = s + ' tarda' 
    else:
        s2 = s.replace('PM','tarda')
        s2 = s2.replace('AM','matí')
    return s2
