#include <bits/stdc++.h>
#include <cassert>
#include <signal.h>
#define N_MAX 4000
using namespace std;
int N;
int A[N_MAX + 5];
int D[N_MAX + 5];
int P[N_MAX + 5], ans[N_MAX + 5];
bool cmp(int a, int b) { return D[a] < D[b]; }
int main() {
cin >> N;
for (int i = 1; i <= N; i++) {
cin >> A[i];
}
sort(A + 1, A + N + 1);
long long ide;
cout << "? ";
for (int i = 1; i <= N; i++) {
cout << A[i] << " ";
}
cout.flush();
cin >> ide;
bool first = true;
int pos = -1;
for (int i = 2; i <= N; i++) {
if (A[i] != A[1]) {
swap(A[i], A[1]);
cout << "? ";
for (int j = 1; j <= N; j++) {
cout << A[j] << " ";
}
cout.flush();
long long query;
cin >> query;
D[i] = (ide - query) / (A[1] - A[i]);
swap(A[i], A[1]);
if (first) {
first = false;
pos = i;
}
}
}
for (int i = 2; i < pos; i++) {
swap(A[i], A[pos]);
cout << "? ";
for (int j = 1; j <= N; j++) {
cout << A[j] << " ";
}
cout.flush();
long long query;
cin >> query;
int dif = (ide - query) / (A[pos] - A[i]);
D[i] = dif + D[pos];
swap(A[i], A[pos]);
}
for (int i = 1; i <= N; i++) {
P[i] = i;
}
sort(P + 1, P + N + 1, cmp);
for (int i = 1; i <= N; i++) {
ans[P[i]] = A[i];
}
cout << "! ";
for (int i = 1; i <= N; i++) {
cout << ans[i] << " ";
}
cout.flush();
return 0;
}