Dictionary of English X30773


Statement
 

pdf   zip

thehtml

Write a program that given a text, lists the words appearing in it grouped by their first letter.

Input

The input is a text, containing no punctuation signs, only letters (either upper or lowercase) and whitespaces.

Output

The output is, for each letter in the alphabet, the list of words in the text starting with that letter, lowercased and sorted alphabetically. Follow the format of the examples

Public test cases
  • Input

    Why do French people eat snails
    They dont like fast food
    
    Why did the golfer wear two pairs of pants
    Just in case he got a hole in one
    
    Why dont the circus lions eat the clowns
    Because they taste funny

    Output

    A: a
    B: because
    C: case circus clowns
    D: did do dont
    E: eat
    F: fast food french funny
    G: golfer got
    H: he hole
    I: in
    J: just
    K:
    L: like lions
    M:
    N:
    O: of one
    P: pairs pants people
    Q:
    R:
    S: snails
    T: taste the they two
    U:
    V:
    W: wear why
    X:
    Y:
    Z:
    
  • Input

    Let the bird of loudest lay
    On the sole Arabian tree
    Herald sad and trumpet be
    To whose sound chaste wings obey
    
    But thou shrieking harbinger
    Foul precurrer of the fiend
    Augur of the fevers end
    To this troop come thou not near
    
    From this session interdict
    Every fowl of tyrant wing
    Save the eagle featherd king
    Keep the obsequy so strict
    
    Let the priest in surplice white
    That defunctive music can
    Be the death divining swan
    Lest the requiem lack his right
    
    And thou  treble dated crow
    That thy sable gender makst
    With the breath thou givst and takst
    Mongst our mourners shalt thou go
    
    Here the anthem doth commence
    Love and constancy is dead
    Phoenix and the turtle fled
    In a mutual flame from hence

    Output

    A: a and anthem arabian augur
    B: be bird breath but
    C: can chaste come commence constancy crow
    D: dated dead death defunctive divining doth
    E: eagle end every
    F: featherd fevers fiend flame fled foul fowl from
    G: gender givst go
    H: harbinger hence herald here his
    I: in interdict is
    J:
    K: keep king
    L: lack lay lest let loudest love
    M: makst mongst mourners music mutual
    N: near not
    O: obey obsequy of on our
    P: phoenix precurrer priest
    Q:
    R: requiem right
    S: sable sad save session shalt shrieking so sole sound strict surplice swan
    T: takst that the this thou thy to treble tree troop trumpet turtle tyrant
    U:
    V:
    W: white whose wing wings with
    X:
    Y:
    Z:
    
  • Information
    Author
    Language
    English
    Official solutions
    Python
    User solutions
    Python