Why does one test case fail

#include
#include
using namespace std;

int main() {
int n;
cin >> n;
vector arr(n);

for (int i = 0; i < n; i++) {
    cin >> arr[i];
}

for (int i = 0; i < n; i++) {
    bool found = false;
    for (int j = 0; j < n; j++) {
        if (arr[j] == arr[i] + 1) {
            cout << arr[j] << " ";
            found = true;
            break;
        }
    }
    if (!found) {
        cout << "-1 ";
    }
}

return 0;

}