Problem: There are some websites that are accessible through several different addresses. For example, for a long time Codeforces was accessible with two hostnames codeforces.com and codeforces.ru.

You are given a list of page addresses being queried. For simplicity we consider all addresses to have the form http://<hostname>[/<path>], where:

  * <hostname> — server name (consists of words and maybe some dots separating them), 
  * /<path> — optional part, where <path> consists of words separated by slashes. 



We consider two <hostname> to correspond to one website if for each query to the first <hostname> there will be exactly the same query to the second one and vice versa — for each query to the second <hostname> there will be the same query to the first one. Take a look at the samples for further clarifications.

Your goal is to determine the groups of server names that correspond to one website. Ignore groups consisting of the only server name.

Please note, that according to the above definition queries http://<hostname> and http://<hostname>/ are different.

Input

The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of page queries. Then follow n lines each containing exactly one address. Each address is of the form http://<hostname>[/<path>], where:

  * <hostname> consists of lowercase English letters and dots, there are no two consecutive dots, <hostname> doesn't start or finish with a dot. The length of <hostname> is positive and doesn't exceed 20. 
  * <path> consists of lowercase English letters, dots and slashes. There are no two consecutive slashes, <path> doesn't start with a slash and its length doesn't exceed 20. 



Addresses are not guaranteed to be distinct.

Output

First print k — the number of groups of server names that correspond to one website. You should count only groups of size greater than one.

Next k lines should contain the description of groups, one group per line. For each group print all server names separated by a single space. You are allowed to print both groups and names inside any group in arbitrary order.

Examples

Input

10
http://abacaba.ru/test
http://abacaba.ru/
http://abacaba.com
http://abacaba.com/test
http://abacaba.de/
http://abacaba.ru/test
http://abacaba.de/test
http://abacaba.com/
http://abacaba.com/t
http://abacaba.com/test


Output

1
http://abacaba.de http://abacaba.ru 


Input

14
http://c
http://ccc.bbbb/aba..b
http://cba.com
http://a.c/aba..b/a
http://abc/
http://a.c/
http://ccc.bbbb
http://ab.ac.bc.aa/
http://a.a.a/
http://ccc.bbbb/
http://cba.com/
http://cba.com/aba..b
http://a.a.a/aba..b/a
http://abc/aba..b/a


Output

2
http://cba.com http://ccc.bbbb 
http://a.a.a http://a.c http://abc 

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

public class hostname {
	public static class DisjointSet {
		public int size;
		public int[] id, rank;

		public DisjointSet(int n) {
			size = n;
			id = new int[n];
			rank = new int[n];
			for(int i = 0; i < n; i++)
				id[i] = i;
		}

		public int find(int x) {
			while(x != id[x])
				x = id[x] = id[id[x]];
			return x;
		}

		public void union(int a, int b) {
			a = find(a);
			b = find(b);

			if(a == b)
				return;

			if(rank[a] > rank[b]) id[b] = a;
			else if(rank[a] < rank[b]) id[a] = b;
			else {
				rank[a]++;
				id[b] = a;
			}
			size--;
		}
	}

	public static class Thingy implements Comparable<Thingy> {
		public int[] arr;
		public boolean hashed;
		public int n, hashCode, index;

		public Thingy(int[] arr, int index) {
			n = arr.length;
			hashed = false;
			this.index = index;
			this.arr = arr;
		}

		@Override
		public int hashCode() {
			if(!hashed) {
				hashed = true;
				hashCode = Arrays.hashCode(arr);
			}
			return hashCode;
		}

		@Override
		public int compareTo(Thingy other) {
			int ptr1 = 0, ptr2 = 0;
			while(ptr1 < this.n && ptr2 < other.n) {
				int cmp = Integer.compare(this.arr[ptr1++], other.arr[ptr2++]);
				if(cmp == 0)
					continue;
				return cmp;
			}
			if(ptr1 == this.n && ptr2 == other.n)
				return 0;
			else if(ptr1 == this.n)
				return -1;
			return 1;
		}

		@Override
		public String toString() {
			return Arrays.toString(arr);
		}
	}

	public static void main(String[] args) throws IOException {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int n = Integer.parseInt(read.readLine());

		Map<String, Set<String>> map = new HashMap<String, Set<String>>();
		Map<String, Integer> map2 = new HashMap<String, Integer>();
		Map<Integer, String> rev = new HashMap<Integer, String>();
		Set<String> paths = new TreeSet<String>();
		int len = 0;
		for(int i = 0; i < n; i++) {
			String s = read.readLine().substring(7);
			String path = "";
			int index = s.indexOf("/");
			if(index > 0) {
				path = s.substring(index);
				s = s.substring(0, index);
			}

			if(!map.containsKey(s)) {
				map.put(s, new HashSet<String>());
				map2.put(s, len);
				rev.put(len++, s);
			}
			map.get(s).add(path);
			paths.add(path);
		}

		Map<String, Integer> map3 = new HashMap<String, Integer>();
		int index = 0;
		for(String s : paths)
			map3.put(s, index++);

		List<Thingy> list = new ArrayList<Thingy>(map.size());
		index = 0;
		for(String s : map.keySet()) {
			Set<String> set = map.get(s);
			int[] arr = new int[set.size()];
			int i = 0;
			for(String ss : set)
				arr[i++] = map3.get(ss);
			Arrays.sort(arr);
			list.add(new Thingy(arr, map2.get(s)));
		}

		Collections.sort(list);
		DisjointSet ds = new DisjointSet(map.size());

		for(int i = 1; i < list.size(); i++) {
			Thingy a = list.get(i), b = list.get(i - 1);
			if(/*a.hashCode() == b.hashCode() && */a.compareTo(b) == 0)
				ds.union(a.index, b.index);
		}

		Map<Integer, Set<String>> ans = new HashMap<Integer, Set<String>>();
		for(int i = 0; i < len; i++) {
			int id = ds.find(i);
			if(!ans.containsKey(id))
				ans.put(id, new HashSet<String>());
			ans.get(id).add(rev.get(i));
		}

		len = 0;
		for(int id : ans.keySet())
			if(ans.get(id).size() > 1)
				len++;

		out.println(len);
		for(int id : ans.keySet()) {
			boolean first = true;
			Set<String> set = ans.get(id);
			if(set.size() == 1)
				continue;

			for(String s : set) {
				if(first) first = false;
				else out.print(" ");
				out.print("http://");
				out.print(s);
			}
			out.println();
		}
		out.close();
	}
}