List<String> top50(List<String> emails, List<String> domains) {
		Map<String, Integer> m=new HashMap<>();
		for (String email:emails) {
			String domain=email.split("@")[1];
			if (m.containsKey(domain)) m.put(domain,m.get(domain)+1);
			else m.put(domain, 1);
		}
		int i=0;
		Queue<Map.Entry<String, Integer>> pq=new PriorityQueue<>(50, new Comparator<Map.Entry<String, Integer>>(){
			@Override
			public int compare(Map.Entry<String, Integer>o1, Map.Entry<String, Integer> o2) {
				return o1.getValue()-o2.getValue();
			}
		});
		for (Map.Entry<String, Integer>e:m.entrySet()) {
			if (pq.size()<50) pq.offer(e);
			else if (pq.peek().getValue()<e.getValue()) {
				pq.poll();pq.offer(e);
			}
		}
		List<String>rel=new ArrayList<>();
		for (i=0;i<50;++i) rel.add(pq.poll().getKey());
		Collections.reverse(rel);
		return rel;
	}