#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 40500;
int h, lgn, n, t, r, x, y, a[N], dis[N], lp[N], dp[N][17];
vector<pair<int, int> > e1, e2;
vector<int> g[N];
bool mark[N];
int lg(int xx) {
  int l = 0;
  while (xx > 1) {
    xx /= 2;
    ++l;
  }
  return l;
}
void bfs(int d, vector<int> &v) {
  vector<int> w;
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < g[v[i]].size(); j++) {
      if (dis[g[v[i]][j]] == INT32_MAX) {
        dis[g[v[i]][j]] = d + 1;
        w.push_back(g[v[i]][j]);
      }
    }
  }
  if (!w.empty()) bfs(d + 1, w);
}
void dfs(int v) {
  mark[v] = true;
  for (int i = 0; i < g[v].size(); i++) {
    if (!mark[g[v][i]]) {
      dis[g[v][i]] = dis[v] + 1;
      dp[g[v][i]][0] = v;
      for (int j = 1; j <= lgn; j++)
        dp[g[v][i]][j] = dp[dp[g[v][i]][j - 1]][j - 1];
      dfs(g[v][i]);
    }
  }
}
int par(int v, int p) {
  while (p > 0) {
    int pp = p & (-p);
    v = dp[v][lg(pp)];
    p -= pp;
  }
  return v;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> h >> t >> r >> x;
  int hh, tt;
  for (int i = 0; i < x; i++) {
    cin >> hh >> tt;
    e1.push_back({hh, tt});
  }
  cin >> y;
  for (int i = 0; i < y; i++) {
    cin >> hh >> tt;
    e2.push_back({hh, tt});
  }
  for (int i = r; i >= 0; i--) {
    for (int j = r - i; j >= 0; j--) {
      for (int k = 0; k < min(x, i); k++) {
        if ((i - k - 1 + e1[k].first + j + e1[k].second) <= r)
          g[(r + 1) * i + j].push_back((i - k - 1 + e1[k].first) * (r + 1) + j +
                                       e1[k].second);
      }
      for (int k = 0; k < min(y, j); k++) {
        if ((i + e2[k].first + j - k - 1 + e2[k].second) <= r)
          g[(r + 1) * i + j].push_back((i + e2[k].first) * (r + 1) + j - k - 1 +
                                       e2[k].second);
      }
    }
  }
  n = (r + 1) * (r + 1);
  lgn = lg(n);
  int s = h * (r + 1) + t;
  fill(dis, dis + n, INT32_MAX);
  vector<int> v;
  v.push_back(s);
  dis[s] = 0;
  bfs(0, v);
  if (dis[0] != INT32_MAX) {
    cout << "Ivan\n" << dis[0];
    return 0;
  }
  for (int i = 0; i < n; i++) fill(dp[i], dp[i] + 17, s);
  dfs(s);
  for (int i = 0; i < n; i++) {
    if (dis[i] != INT32_MAX) {
      for (int j = 0; j < g[i].size(); j++) {
        if (dis[g[i][j]] <= dis[i] &&
            g[i][j] == par(i, dis[i] - dis[g[i][j]])) {
          cout << "Draw";
          return 0;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (dis[i] != INT32_MAX) {
      for (int j = 0; j < g[i].size(); j++) ++a[g[i][j]];
    }
  }
  vector<int> w;
  w.push_back(s);
  while (!w.empty()) {
    int u = w[w.size() - 1];
    w.pop_back();
    for (int i = 0; i < g[u].size(); i++) {
      --a[g[u][i]];
      lp[g[u][i]] = max(lp[g[u][i]], lp[u] + 1);
      if (a[g[u][i]] == 0) w.push_back(g[u][i]);
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, lp[i]);
  cout << "Zmey\n" << ans + 1;
}
