#define _CRT_SECURE_NO_WARNINGS #include #include #include #include using namespace std; struct moniker { string name; bool gen; }; vector nominal; vector > type; vector >> rel; void Com_And_Fill(string n1, string rap, string n2) { int ind; for (int i = 0; i < nominal.size(); i++) { if (n1 == nominal[i].name) { ind = i; } } } int main() { type.push_back(make_pair("Husband", "Wife"));//0 type.push_back(make_pair("Father", "Mother"));//1 type.push_back(make_pair("Son", "Daughter"));//2 type.push_back(make_pair("Brother", "Sister"));//3 type.push_back(make_pair("Grandfather", "Grandmother"));//4 type.push_back(make_pair("Grandson", "Granddaughter"));//5 type.push_back(make_pair("Nephew", "Niece"));//6 type.push_back(make_pair("Uncle", "Aunt"));//7 type.push_back(make_pair("Son_In_Law", "Daughter_In_Law"));//8 type.push_back(make_pair("Mother_In_Law_From_Wife", "Father_In_Law_From_Wife"));//9 type.push_back(make_pair("Father_In_Law_From_Husband", "Mother_In_Law_From_Husband"));//10 int N; scanf("%d", &N); nominal.resize(N); string a, b, c; for (int i = 0; i < N; ++i) { cin >> nominal[i].name >> a; if (a[0] = 'M') nominal[i].gen = true; else nominal[i].gen = false; } int M; scanf("%d", &M); for (int i = 0; i < M; ++i) { cin >> a >> b >> c; Com_And_Fill(a, b, c); } return 0; }