#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, vector<pair<int, int> > > a;
map<pair<int, int>, int> mark;
map<pair<int, int>, int> mark2;
map<pair<int, int>, int> fary;
bool tiac = 0;
void bfs(pair<int, int> x) {
  queue<pair<int, int> > q;
  q.push(x);
  mark[x] = 1;
  while (!q.empty()) {
    pair<int, int> v = q.front();
    q.pop();
    for (auto i : a[v]) {
      if (mark[i] == 0) {
        q.push(i);
        mark[i] = mark[v] + 1;
      }
    }
  }
}
void dfs(pair<int, int> x) {
  mark2[x] = 1;
  for (auto i : a[x]) {
    if (mark2[i] == 0) {
      dfs(i);
    } else if (mark2[i] == 1) {
      tiac = 1;
      return;
    }
  }
  mark2[x] = 2;
}
int far(pair<int, int> x) {
  if (fary[x]) return fary[x];
  int farx = 0;
  for (auto i : a[x]) {
    farx = max(farx, far(i) + 1);
  }
  return fary[x] = farx;
}
int main() {
  int h, t, r, n, m, h1, b;
  cin >> h >> t >> r;
  cin >> n;
  for (int l = 1; l <= n; l++) {
    cin >> h1 >> b;
    for (int i = l; i <= r; i++) {
      for (int j = 0; j <= r - i; j++) {
        a[make_pair(i, j)].push_back(make_pair(i - l + h1, j + b));
      }
    }
  }
  cin >> m;
  for (int l = 1; l <= m; l++) {
    cin >> h1 >> b;
    for (int i = 0; i <= r; i++) {
      for (int j = l; j <= r - i; j++) {
        a[make_pair(i, j)].push_back(make_pair(i + h1, j + b - l));
      }
    }
  }
  bfs(make_pair(h, t));
  dfs(make_pair(h, t));
  if (mark[make_pair(0, 0)] != 0) {
    cout << "Ivan" << endl << mark[make_pair(0, 0)] - 1;
  } else if (tiac == 1) {
    cout << "Draw";
  } else {
    cout << "Zmey" << endl << far(make_pair(h, t));
  }
}
