#include <iostream>
using namespace std;
int main() {
int n, i, j, k;
int tab[1000];
cin >> n;
for(int i=0;i<n;i++) {
cin >> tab[i];
}
cin >> i >> j >> k;
cout << tab[i-1] << " " << tab[j-1] << " " << tab[k-1] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCBuLCBpLCBqLCBrOwoJaW50IHRhYlsxMDAwXTsKCWNpbiA+PiBuOwoJZm9yKGludCBpPTA7aTxuO2krKykgewoJCWNpbiA+PiB0YWJbaV07Cgl9CgljaW4gPj4gaSA+PiBqID4+IGs7Cgljb3V0IDw8IHRhYltpLTFdIDw8ICIgIiA8PCB0YWJbai0xXSA8PCAiICIgPDwgdGFiW2stMV0gPDwgZW5kbDsKCglyZXR1cm4gMDsKfQ==