// Arup Guha
// 10/20/2018
// Example of the use of bitwise operators, written for Junior Knights

import java.util.*;

public class candy {
	
	final public static String[] CANDY = {"Snickers", "M&Ms", "Skittles", "Butterfinger", "Twizzlers"};
	
	// a << b left shift a by b bits, value = a * 2^b
	// a >> b right shift a by b bits, value = a/(2^b)
	// a & b is a AND b (1s only if both a and b have 1s)
	// a | b is a OR b (1s if at least one of a or b has 1s)
	// a ^ b is a XOR b (1s if exactly one of a and b has 1s)
	
	public static void main(String[] args) {
		
		int n = CANDY.length; 
		for (int sub=0; sub<(1<<n); sub++) {
			
			ArrayList<String> myset = new ArrayList<String>();
			
			// Go through all items, see which ones are in set.
			for (int item=0; item<n; item++) {
				if ((sub & (1<<item)) != 0)
					myset.add(CANDY[item]);
			}
			Collections.sort(myset);
			System.out.println(myset);
			
		}
		
	}

}
