def toGoatLatin(S):
    vowel = set('aeiouAEIOU')
    def latin(w, i):
        if w[0] not in vowel:
            w = w[1:] + w[0]
        return w + 'ma' + 'a' * (i + 1)
    return ' '.join(latin(w, i) for i, w in enumerate(S.split()))

s="I speak Goat Latin"
tmp = s.split()
ret = toGoatLatin(s)
160c14facd3dc0f62eac44eb66fda20b1e7a5839
<mask token>

def toGoatLatin(S):
    vowel = set('aeiouAEIOU')

    def latin(w, i):
        if w[0] not in vowel:
            w = w[1:] + w[0]
        return w + 'ma' + 'a' * (i + 1)
    return ' '.join(latin(w, i) for i, w in enumerate(S.split()))


<mask token>

def toGoatLatin(S):
    vowel = set('aeiouAEIOU')

    def latin(w, i):
        if w[0] not in vowel:
            w = w[1:] + w[0]
        return w + 'ma' + 'a' * (i + 1)
    return ' '.join(latin(w, i) for i, w in enumerate(S.split()))


s = 'I speak Goat Latin'
tmp = s.split()
ret = toGoatLatin(s)

def toGoatLatin(S):
    vowel = set('aeiouAEIOU')
    def latin(w, i):
        if w[0] not in vowel:
            w = w[1:] + w[0]
        return w + 'ma' + 'a' * (i + 1)
    return ' '.join(latin(w, i) for i, w in enumerate(S.split()))

s="I speak Goat Latin"
tmp = s.split()
ret = toGoatLatin(s)