func_code_string: #include <bits/stdc++.h>   using namespace std;   int h, t, R;   int n, m;   vector<pair<int, int> > H, T;   int D[201][201];   int shortestWin() {     memset(D, -1, sizeof(D));     queue<pair<int, int> > q;     for (int i = 1; i <= n; i++) {       pair<int, int> s;       s.first = i;       s.second = 0;       if (i <= R && H[i - 1].first == 0 && H[i - 1].second == 0) {         q.push(s);         D[i][0] = 1;       }     }     for (int i = 1; i <= m; i++) {       pair<int, int> s;       s.first = 0;       s.second = i;       if (i <= R && T[i - 1].first == 0 && T[i - 1].second == 0) {         q.push(s);         D[0][i] = 1;       }     }     while (!q.empty()) {       pair<int, int> u = q.front();       q.pop();       for (int i = 0; i < n; i++) {         pair<int, int> v;         v.first = u.first + (i + 1) - (H[i].first);         v.second = u.second - (H[i].second);         if (v.first + v.second <= R) {           if (v.first >= 0 && v.second >= 0 && v.first >= (i + 1)) {             if (D[v.first][v.second] == -1) {               D[v.first][v.second] = D[u.first][u.second] + 1;               q.push(v);             }           }         }       }       for (int i = 0; i < m; i++) {         pair<int, int> v;         v.first = u.first - (T[i].first);         v.second = u.second + (i + 1) - (T[i].second);         if (v.first + v.second <= R) {           if (v.first >= 0 && v.second >= 0 && v.second >= (i + 1)) {             if (D[v.first][v.second] == -1) {               D[v.first][v.second] = D[u.first][u.second] + 1;               q.push(v);             }           }         }       }     }     return D[h][t];   }   int V[201][201];   int dp(int h, int t) {     if (h + t > R || h < 0 || t < 0) {       return 0;     }     if (V[h][t] == 1) {       return 1000000000;     }     if (D[h][t] != -1) {       return D[h][t];     }     V[h][t] = 1;     int best = 0;     for (int i = 0; i < n; i++) {       if (i + 1 > h) break;       int vh = h - (i + 1) + H[i].first;       int vt = t + H[i].second;       best = max(best, dp(vh, vt) + 1);     }     for (int i = 0; i < m; i++) {       if (i + 1 > t) break;       int vh = h + T[i].first;       int vt = t - (i + 1) + T[i].second;       best = max(best, dp(vh, vt) + 1);     }     D[h][t] = best;     V[h][t] = 2;     return D[h][t];   }   int main() {     cin >> h >> t >> R;     cin >> n;     H.resize(n);     for (int i = 0; i < n; i++) {       cin >> H[i].first >> H[i].second;     }     cin >> m;     T.resize(m);     for (int i = 0; i < m; i++) {       cin >> T[i].first >> T[i].second;     }     int winningPath = shortestWin();     if (winningPath != -1) {       cout <<  Ivan n  << winningPath <<   n ;     } else {       memset(D, -1, sizeof(D));       memset(V, 0, sizeof(V));       int losingPath = dp(h, t);       if (losingPath >= 1000000000) {         cout <<  Draw n ;       } else {         cout <<  Zmey n  << losingPath <<   n ;       }     }   }   