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.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class CrocB {

	static TreeMap<String, Integer> hostID, pathID;
	static ArrayList<String> hostName;
	static TreeSet<Query> set;
	static int idx1, idx2;
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();
		hostID = new TreeMap<String, Integer>();
		pathID = new TreeMap<String, Integer>();
		hostName = new ArrayList<String>(n);
		set = new TreeSet<Query>();
		for(int i = 0; i < n; ++i)
			insert(sc.next());
		Node root = new Node();
		int hosts = hostName.size();
		int[] lastPath = new int[hosts];
		Node[] curNode = new Node[hosts];
		Arrays.fill(curNode, root);
		Arrays.fill(lastPath, -1);
		
		Iterator<Query> itr = set.descendingIterator();
		while(itr.hasNext())
		{
			Query q = itr.next();
			if(lastPath[q.host] == -1)
				lastPath[q.host] = q.path;
		}
		
		itr = set.iterator();
		while(itr.hasNext())
		{
			Query q = itr.next();
			Node cur = curNode[q.host];
			Node nxt = cur.next.get(q.path);
			if(nxt == null)
			{
				nxt = new Node();
				cur.next.put(q.path, nxt);
			}
			curNode[q.host] = nxt;
			if(lastPath[q.host] == q.path)
				curNode[q.host].hosts.add(q.host);
		}
		
		ArrayList<StringBuilder> ans = new ArrayList<StringBuilder>();
		for(Node node: curNode)
			if(node.hosts != null && node.hosts.size() > 1)
			{
				StringBuilder sb = new StringBuilder();
				for(Integer h: node.hosts)
					sb.append(hostName.get(h)).append(" ");
				node.hosts = null;
				ans.add(sb);
			}
		out.println(ans.size());
		for(StringBuilder sb: ans)
			out.println(sb);
		
		out.flush();
		out.close();

	}
	
	static class Node
	{
		TreeMap<Integer, Node> next = new TreeMap<Integer, Node>();
		ArrayList<Integer> hosts = new ArrayList<Integer>();
		
	}
	
	static void insert(String s)
	{
		int idx = 7;
		while(idx < s.length() && s.charAt(idx) != '/')
			++idx;
		String host = s.substring(0, idx), path = "";
		if(idx < s.length())
			path = s.substring(idx);
		
		Integer f1 = hostID.get(host), f2 = pathID.get(path);
		if(f1 == null)
		{	
			hostID.put(host, f1 = idx1++);
			hostName.add(host);
		}
		if(f2 == null)
		{
			pathID.put(path, f2 = idx2++);
			
		}
		set.add(new Query(f1, f2));
	}
	
	static class Query implements Comparable<Query>
	{
		int host, path;
		
		Query(int x, int y)
		{
			host = x;
			path = y;
		}
		
		public int compareTo(Query q)
		{
			if(host != q.host)
				return host - q.host;
			return path - q.path;
		}
	
	}


	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}


	}
}