#include <iostream>
using namespace std;
long long a[1000001], maxm = 0, minm = LONG_LONG_MAX; int i, k, n;;
int main() {
scanf("%d", &n);
for (i = 1; i <= n; i++) scanf("%d", a + i);
for (i = 1; i <= n; i++) {
maxm = max(maxm, a[i]);
minm = min(minm, a[i]);
}
for (i = 1; i <= n; i++) printf("%d ", maxm - a[i]);
printf("\n");
for (i = 1; i <= n; i++) printf("%d ", maxm - a[i]);
return 0;
}