#K41697. Find the Two Duplicates

    ID: 26923 Type: Default 1000ms 256MiB

Find the Two Duplicates

Find the Two Duplicates

Given an integer \(n\) and an array of \(n+2\) integers, where each integer between \(1\) and \(n\) appears exactly once except for two numbers that appear twice, your task is to find these two duplicate numbers and output them in ascending order.

Note: The array contains \(n+2\) elements, which means it includes exactly two duplicates. Ensure to output the duplicates sorted in increasing order.

inputFormat

The input is given via stdin as follows:

  1. The first line contains an integer \(n\) representing the number of unique elements.
  2. The second line contains \(n+2\) space-separated integers.

outputFormat

Output via stdout the two duplicate numbers in ascending order, separated by a space.

## sample
6
1 3 2 5 4 3 6 2
2 3