#P1157E. Minimum Array
Minimum Array
Description
You are given two arrays and , both of length . All elements of both arrays are from to .
You can reorder elements of the array (if you want, you may leave the order of elements as it is). After that, let array be the array of length , the -th element of this array is , where is modulo .
Your task is to reorder elements of the array to obtain the lexicographically minimum possible array .
Array of length is lexicographically less than array of length , if there exists such (), that , and for any () .
The first line of the input contains one integer () — the number of elements in , and .
The second line of the input contains integers (), where is the -th element of .
The third line of the input contains integers (), where is the -th element of .
Print the lexicographically minimum possible array . Recall that your task is to reorder elements of the array and obtain the lexicographically minimum possible array , where the -th element of is .
Input
The first line of the input contains one integer () — the number of elements in , and .
The second line of the input contains integers (), where is the -th element of .
The third line of the input contains integers (), where is the -th element of .
Output
Print the lexicographically minimum possible array . Recall that your task is to reorder elements of the array and obtain the lexicographically minimum possible array , where the -th element of is .