#include <stdio.h>
#include <stdlib.h>
int A[5];
int B[5];
int cmp(const void *a, const void *b)
{
return A[*(int*)a] - A[*(int*)b];
}
int main()
{
for (int i = 0; i < 5; i++)
{
scanf("%d", &A[i]);
B[i] = i;
}
qsort(B, 5, sizeof(int), cmp);
for (int i = 0; i < 5; i++)
{
printf("%d ", A[B[i]]);
}
printf("\n");
for (int i = 0; i < 5; i++)
{
printf("%d ", B[i]);
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCmludCBBWzVdOwppbnQgQls1XTsKCmludCBjbXAoY29uc3Qgdm9pZCAqYSwgY29uc3Qgdm9pZCAqYikKewoJcmV0dXJuIEFbKihpbnQqKWFdIC0gQVsqKGludCopYl07Cn0KCmludCBtYWluKCkKewoJZm9yIChpbnQgaSA9IDA7IGkgPCA1OyBpKyspCgl7CgkJc2NhbmYoIiVkIiwgJkFbaV0pOwoJCUJbaV0gPSBpOwoJfQoJcXNvcnQoQiwgNSwgc2l6ZW9mKGludCksIGNtcCk7Cglmb3IgKGludCBpID0gMDsgaSA8IDU7IGkrKykKCXsKCQlwcmludGYoIiVkICIsIEFbQltpXV0pOwoJfQoJcHJpbnRmKCJcbiIpOwoJZm9yIChpbnQgaSA9IDA7IGkgPCA1OyBpKyspCgl7CgkJcHJpbnRmKCIlZCAiLCBCW2ldKTsKCX0KfQ==