/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		String[] a = {"a","b","c","d"};
		String[] b = {"b", "c", "e"};
		
		//this is to avoid calling Arrays.asList multiple times
		List<String> aL = Arrays.asList(a);
		List<String> bL = Arrays.asList(b);
		
		//finding the common element for both
		Set<String> common = new HashSet<>(aL);
		common.retainAll(bL);
		System.out.println("Common: " + common);
		
		//now, the real uncommon elements
		Set<String> uncommon = new HashSet<>(aL);
		uncommon.addAll(bL);
		uncommon.removeAll(common);
		System.out.println("Uncommon: " + uncommon);
	}
}