Can you show me an effective algorithm to create all possible words(of any combination) from some characters inputted?

Eg:
Input: a,b,c

Output:
abc
acb
bac
bca
cab
cba