def comparing_rotated_words(word):
    w = sorted(list(word))
    pos_sol = []
    for i in range(len(word.lower())):
        if w[0] == word[i]:
            pos_sol.append([i, word[i:]+word[:i]])

    return str(sorted(pos_sol, key=lambda x: x[1])[0][0]) + ' ' + sorted(pos_sol, key=lambda x: x[1])[0][1]

print(comparing_rotated_words('onion'))
print(comparing_rotated_words('bbaaccaadd'))
print(comparing_rotated_words('alfalfa'))
print(comparing_rotated_words('weugweougewoiheew'))
print(comparing_rotated_words('pneumonoultramicroscopicsilicovolcanoconiosis'))