#include <bits/stdc++.h>
using namespace std;
const int nax = 205;
vector<pair<int, int>> heads(nax), tails(nax);
int n, m, r;
vector<vector<int>> dp(nax, vector<int>(nax, -1));
vector<int> visited(nax*(nax + 1), 0), mdist(nax*(nax + 1), 0);
vector<vector<int>> adj(nax*(nax + 1));
bool candraw = false;
int md = 0;
bool dfs(int v) {
  visited[v] = 1;
  mdist[v] = 0;
  for (auto x : adj[v]) {
    if (visited[x] == 1) {
      return true;
    }
    if (!visited[x]) {
      if (dfs(x)) return true;
    }
    mdist[v] = max(mdist[v], 1 + mdist[x]);
    md = max(md, mdist[v]);
  }
  visited[v] = 2;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int h, t;
  cin >> h >> t >> r >> n;
  for (int i = 1; i <= n; i++) {
    cin >> heads[i].first >> heads[i].second;
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> tails[i].first >> tails[i].second;
  }
  priority_queue<pair<int, pair<int, int>>> pq;
  pq.push({0, {h, t}});
  visited[h * nax + t] = 1;
  int cmoves, ch, ct;
  while (!pq.empty()) {
    auto temp = pq.top();
    pq.pop();
    cmoves = -temp.first;
    ch = temp.second.first;
    ct = temp.second.second;
    if (!ch && !ct) {
      cout << "Ivan\n" << cmoves;
      return 0;
    }
    for (int i = min(n, ch); i > 0; i--) {
      int nh = ch - i + heads[i].first;
      int nt = ct + heads[i].second;
      if (nh + nt > r) continue;
      adj[ch * nax + ct].push_back(nh * nax + nt);
      if (!visited[nh * nax + nt]) {
        visited[nh * nax + nt] = 1;
        pq.push({-(cmoves + 1), {nh, nt}});
      }
    }
    for (int i = min(m, ct); i > 0; i--) {
      int nt = ct - i + tails[i].second;
      int nh = ch + tails[i].first;
      if (nh + nt > r) continue;
      adj[ch * nax + ct].push_back(nh * nax + nt);
      if (!visited[nh * nax + nt]) {
        visited[nh * nax + nt] = 1;
        pq.push({-(cmoves + 1), {nh, nt}});
      }
    }
  }
  visited.assign(nax * (nax + 1), 0);
  candraw = dfs(h * nax + t);
  if (candraw) {
    cout << "Draw";
  } else {
    cout << "Zmey\n";
    cout << md + 1;
  }
  return 0;
}
