solves print all string combinations