public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int inputCount = 0;
		Map<String, Integer> book = new HashMap<String, Integer>();
		if (in.hasNext()) {
			inputCount = in.nextInt();
		}
		for (int i = 0; i < inputCount; i++) {
			String callNumOri = in.next();
			String callNum = decodePhoneNumber(callNumOri);
			if (book.containsKey(callNum)) {
				book.put(callNum, book.get(callNum) + 1);
			} else {
				book.put(callNum, 1);
			}
		}
		Map<String, Integer> bookTree = new TreeMap<String, Integer>(book);
		Iterator<Entry<String, Integer>> iter = bookTree.entrySet().iterator();
		boolean flag = true;
		while (iter.hasNext()) {
			Entry<String, Integer> entry = iter.next();
			if (entry.getValue() > 1) {
				System.out.println(entry.getKey() + " " + entry.getValue());
				flag = false;
			}
		}
		if (flag) {
			System.out.println("No duplicates.");
		}
	}