#include <bits/stdc++.h>
using namespace std;
const long long maxn = 202;
int d[maxn][maxn];
bool b[maxn][maxn];
int stv[maxn][maxn];
int fiv[maxn][maxn];
int a1[maxn], a2[maxn], b1[maxn], b2[maxn];
queue<pair<int, int> > q;
vector<pair<int, int> > g[maxn][maxn];
int n, m, h, l, r;
int ind = 1;
bool e = 0;
int s, t;
void dfs(int v, int u) {
  if (e == 1) {
    return;
  }
  for (int i = 0; i < g[v][u].size(); i++) {
    s = g[v][u][i].first;
    t = g[v][u][i].second;
    if (b[s][t] == 0) {
      b[s][t] = 1;
      d[s][t] = d[v][u] + 1;
      dfs(s, t);
    } else {
      if (stv[s][t] <= stv[v][u] && fiv[s][t] >= fiv[v][u]) {
        e = 1;
        return;
      }
      if (d[v][u] >= d[s][t]) {
        d[s][t] = d[v][u] + 1;
        dfs(s, t);
      }
    }
  }
  return;
}
void dfsd(int v, int u) {
  ind++;
  stv[v][u] = ind;
  for (int i = 0; i < g[v][u].size(); i++) {
    s = g[v][u][i].first;
    t = g[v][u][i].second;
    if (b[s][t] == 0) {
      b[s][t] = 1;
      dfsd(s, t);
    }
  }
  ind++;
  fiv[v][u] = ind;
  return;
}
void bfs(int v, int u, int h) {
  h++;
  for (int i = 0; i < g[v][u].size(); i++) {
    s = g[v][u][i].first;
    t = g[v][u][i].second;
    if (b[s][t] == 0) {
      b[s][t] = 1;
      d[s][t] = h;
      q.push({s, t});
    }
  }
  return;
}
void gam(int v, int u) {
  for (int i = 0; i < n; i++) {
    if (v > i) {
      s = v + a1[i];
      t = u + a2[i];
      if (s < 0) {
        s = 0;
      }
      if (t < 0) {
        t = 0;
      }
      if (s + t <= r) {
        g[v][u].push_back({s, t});
        if (b[s][t] == 0) {
          b[s][t] = 1;
          gam(s, t);
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (u > i) {
      s = v + b1[i];
      t = u + b2[i];
      if (s < 0) {
        s = 0;
      }
      if (t < 0) {
        t = 0;
      }
      if (s + t <= r) {
        g[v][u].push_back({s, t});
        if (b[s][t] == 0) {
          b[s][t] = 1;
          gam(s, t);
        }
      }
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> h >> l >> r;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a1[i];
    cin >> a2[i];
    a1[i] -= i + 1;
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> b1[i];
    cin >> b2[i];
    b2[i] -= i + 1;
  }
  b[h][l] = 1;
  gam(h, l);
  if (b[0][0] == 1) {
    d[h][l] = 0;
    for (int i = 0; i < maxn; i++) {
      fill(b[i], b[i] + maxn, 0);
    }
    b[h][l] = 1;
    q.push({h, l});
    while (q.size() != 0) {
      s = q.front().first;
      t = q.front().second;
      q.pop();
      bfs(s, t, d[s][t]);
    }
    cout << "Ivan" << endl;
    cout << d[0][0];
  } else {
    for (int i = 0; i < maxn; i++) {
      fill(b[i], b[i] + maxn, 0);
    }
    b[h][l] = 1;
    dfsd(h, l);
    for (int i = 0; i < maxn; i++) {
      fill(b[i], b[i] + maxn, 0);
    }
    b[h][l] = 1;
    d[h][l] = 0;
    dfs(h, l);
    if (e == 1) {
      cout << "Draw";
    } else {
      long maxx = 0;
      for (int i = 0; i < maxn; i++) {
        for (int j = 0; j < maxn; j++) {
          if (d[i][j] > maxx) {
            maxx = d[i][j];
          }
        }
      }
      cout << "Zmey" << endl;
      cout << maxx + 1;
    }
  }
}
