Group strings by activity