def getNums(listitems):
    answer = []
    # Fill in code here
    for i in listitems:
        if type(i) == list:
            answer += getNums(i)
        else:
            answer.append(i)
    return answer


def poem():
    ret = "Hello world!" + "\n"
    ret += "Ifmmp xpsme!" + "\n"
    ret += "ello-Hay orld-Way" + "\n"
    data = [(10, "d"), (2, "e"), (8, "r"), (4, "l"), (1, "H"),
                (3, "l"), (5, "o "), (9, "l"), (6, "w"), (7, "o")]
    ret += "".join([x[1] for x in sorted(data)]) + "\n"
    ret += " ".join([str(i) for i in getNums([[8, 5, 12, 12, 15],
                                                [23, 15, 18, 12, 4]])]) + "\n\n"

    ret += "From a simple print statement \n" # In reference to above
    ret += "To turtles and shapes \n"
    ret += "On ciphers and codes \n"
    ret += "We cut the red tape \n\n"

    ret += "From functions with parameters \n"
    ret += "To variables and more \n"
    ret += "APTs kept us thinking \n"
    ret += "Though they were ne'er a chore \n\n"

    ret += "From snakes in the classroom \n"
    ret += "To slides and cookies \n"
    ret += "Lots of learning and coding \n"
    ret += "Skills I hope to increase \n"

    return ret


if __name__ == "__main__":
    print(poem())
