func_code_string: #include <bits/stdc++.h>   using namespace std;   const int M = 500;   int R, n, m, d[M][M];   pair<int, int> hd[M], tl[M], par[M][M];   bool wins = 0, draw = 0;   int mark[M][M];   void dfs(int x, int y) {     if (x < 0 || y < 0) return;     if (x + y > R) {       mark[x][y] = 2;       return;     }     mark[x][y] = 1;     if (x + y == 0) {       wins = 1;       return;     }     for (int i = 1; i <= min(n, x); i++) {       int nx = x - i + hd[i].first, ny = y + hd[i].second;       if (mark[nx][ny] == 1)         draw = 1;       else if (mark[nx][ny] == 0)         dfs(nx, ny);     }     for (int i = 1; i <= min(m, y); i++) {       int nx = x + tl[i].first, ny = y - i + tl[i].second;       if (mark[nx][ny] == 1)         draw = 1;       else if (mark[nx][ny] == 0)         dfs(nx, ny);     }     mark[x][y] = 2;   }   int dp[M][M], dis;   void dfs2(int x, int y) {     if (x + y > R) {       dis = max(dis, dp[x][y]);       return;     }     for (int i = 1; i <= min(n, x); i++) {       int nx = x - i + hd[i].first, ny = y + hd[i].second;       if (nx >= 0 && ny >= 0 && (dp[nx][ny] == 0 || (dp[nx][ny] < dp[x][y] + 1)))         dp[nx][ny] = dp[x][y] + 1, dfs2(nx, ny);     }     for (int i = 1; i <= min(m, y); i++) {       int nx = x + tl[i].first, ny = y - i + tl[i].second;       if (nx >= 0 && ny >= 0 && (dp[nx][ny] == 0 || (dp[nx][ny] < dp[x][y] + 1)))         dp[nx][ny] = dp[x][y] + 1, dfs2(nx, ny);     }   }   int main() {     int h, t;     scanf( %d %d %d , &h, &t, &R);     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d %d , &hd[i].first, &hd[i].second);     scanf( %d , &m);     for (int i = 1; i <= m; i++) scanf( %d %d , &tl[i].first, &tl[i].second);     dfs(h, t);     if (!wins && draw) return printf( Draw n ), 0;     memset(mark, 0, sizeof mark);     if (wins) {       printf( Ivan n );       queue<pair<int, int> > q;       d[h][t] = 0;       mark[h][t] = 1;       q.push({h, t});       while (q.size()) {         int x = q.front().first, y = q.front().second;         q.pop();         for (int i = 1; i <= min(x, n); i++) {           int nx = x - i + hd[i].first, ny = y + hd[i].second;           if (nx >= 0 && ny >= 0 && nx + ny <= R) {             if (!mark[nx][ny] or (mark[nx][ny] && d[nx][ny] > d[x][y] + 1))               mark[nx][ny] = 1, d[nx][ny] = d[x][y] + 1, q.push({nx, ny});           }         }         for (int i = 1; i <= min(m, y); i++) {           int nx = x + tl[i].first, ny = y - i + tl[i].second;           if (nx >= 0 && ny >= 0 && nx + ny <= R) {             if (!mark[nx][ny] or (mark[nx][ny] && d[nx][ny] > d[x][y] + 1))               mark[nx][ny] = 1, d[nx][ny] = d[x][y] + 1, q.push({nx, ny});           }         }       }       printf( %d , d[0][0]);     } else {       printf( Zmey n );       dfs2(h, t);       printf( %d , dis);     }     return 0;   }   