In a large saucepan, stir the sugar, cider and vinegar over medium heat until the sugar is dissolved. Add the cranberries, apples, ginger and red pepper flakes. Bring to a boil and then reduce to medium heat and cook, stirring occasionally, for about 25 minutes. Remove saucepan from heat and season the chutney with salt and pepper. Allow the mixture to cool. Transfer to an airtight jar. When sealed and refrigerated, the chutney will keep for several days.