#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
struct nomekop {
ll pos, delta_attack, companion;
bool done;
};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> a(n);
for (ll& x : a)
cin >> x;
// all same
if (count(a.begin(), a.end(), a[0]) == n) {
cout << "!";
for (int i = 0; i < n; i++)
cout << " " << a[i];
cout << endl;
return 0;
}
cout << "?";
for (int i = 0; i < n; i++)
cout << " " << a[i];
cout << endl;
ll baseline;
cin >> baseline;
vector<nomekop> opponents(n);
auto const test_against = [&](int const f) {
for (int i = 0; i < n; i++) {
if (i == f || a[i] == a[f] || opponents[i].done)
continue;
cout << "?";
for (int j = 0; j < n; j++) {
cout << " ";
if (j == i)
cout << a[f];
else if (j == f)
cout << a[i];
else
cout << a[j];
}
cout << endl;
ll cur;
cin >> cur;
ll delta = cur - baseline;
opponents[i].pos = i;
opponents[i].delta_attack = delta / (a[f] - a[i]) + opponents[f].delta_attack;
opponents[i].done = true;
}
};
test_against(0);
for (int i = 1; i < n; i++) {
if (a[i] != a[0]) {
test_against(i);
break;
}
}
sort(opponents.begin(), opponents.end(), [&](nomekop const& a, nomekop const& b) {
return a.delta_attack < b.delta_attack;
});
sort(a.begin(), a.end());
for (int i = 0; i < n; i++)
opponents[i].companion = a[i];
sort(opponents.begin(), opponents.end(), [&](nomekop const& a, nomekop const& b) {
return a.pos < b.pos;
});
cout << "!";
for (nomekop const& x : opponents)
cout << " " << x.companion;
cout << endl;
}