#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main() {
int N,jum=0;
cin >> N;
vector<int> data;
for (int i=0;i<N;i++){
int x;
cin >>x;
data.push_back(x);
jum+=x; //jum = jum + x;
}
for (int i=0;i<N;i++){
cout << jum-data[i] <<endl;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KI2luY2x1ZGUgPHZlY3Rvcj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgaW50IE4sanVtPTA7CiAgICBjaW4gPj4gTjsKICAgIAogICAgdmVjdG9yPGludD4gZGF0YTsKICAgIGZvciAoaW50IGk9MDtpPE47aSsrKXsKICAgICAgICBpbnQgeDsKICAgICAgICBjaW4gPj54OwogICAgICAgIGRhdGEucHVzaF9iYWNrKHgpOwogICAgICAgIAogICAgICAgIGp1bSs9eDsgLy9qdW0gPSBqdW0gKyB4OwogICAgfQogICAgCiAgICBmb3IgKGludCBpPTA7aTxOO2krKyl7CiAgICAgICAgY291dCA8PCBqdW0tZGF0YVtpXSA8PGVuZGw7CiAgICB9Cn0=
I2luY2x1ZGUgJmx0O2lvc3RyZWFtJmd0OwojaW5jbHVkZSAmbHQ7aW9tYW5pcCZndDsKI2luY2x1ZGUgJmx0O3ZlY3RvciZndDsKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewogICAgaW50IE4sanVtPTA7CiAgICBjaW4gJmd0OyZndDsgTjsKICAgIAogICAgdmVjdG9yJmx0O2ludCZndDsgZGF0YTsKICAgIGZvciAoaW50IGk9MDtpJmx0O047aSsrKXsKICAgICAgICBpbnQgeDsKICAgICAgICBjaW4gJmd0OyZndDt4OwogICAgICAgIGRhdGEucHVzaF9iYWNrKHgpOwogICAgICAgIAogICAgICAgIGp1bSs9eDsgLy9qdW0gPSBqdW0gKyB4OwogICAgfQogICAgCiAgICBmb3IgKGludCBpPTA7aSZsdDtOO2krKyl7CiAgICAgICAgY291dCAmbHQ7Jmx0OyBqdW0tZGF0YVtpXSAmbHQ7Jmx0O2VuZGw7CiAgICB9Cn0=
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main() {
int N,jum=0;
cin >> N;
vector<int> data;
for (int i=0;i<N;i++){
int x;
cin >>x;
data.push_back(x);
jum+=x; //jum = jum + x;
}
for (int i=0;i<N;i++){
cout << jum-data[i] <<endl;
}
}