#include <algorithm> #include <climits> #include <cctype> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <set> #include <sstream> #include <numeric> #include <string> #include <vector> #include <queue> int main() { std::map<int, int> f1; std::map<int, int> f2; std::string line1; std::getline(std::cin, line1); std::istringstream iss1{ line1 }; int ai; int i = 1; while (iss1 >> ai) { f1[i] = ai; i++; } std::string line2; std::getline(std::cin, line2); std::istringstream iss2{ line2 }; int aj; int j = 1; while (iss2 >> aj) { f2[j] = aj; j++; } std::map<int, int> f3; for (int k = 1; k < j; k++) { f3[k] = f1[f2[k]]; } for (auto c : f3) { std::cout << c.second << " "; } std::cout << '\n'; }