#include <bits/stdc++.h>
using namespace std;
const int maxn = 250;
const int inf = 1e9;
int dp[maxn][maxn], dp1[maxn][maxn], h, t, r, n, m, tmp;
queue<pair<int, int> > q;
pair<int, int> a[maxn], b[maxn];
int si[maxn][maxn];
pair<int, int> help = make_pair(0, 0);
void dfs(pair<int, int> v) {
  si[v.first][v.second] = 1;
  for (int i = 1; i <= min(v.first, n); i++) {
    pair<int, int> x = v;
    x.first -= i;
    x.first += a[i].first;
    x.second += a[i].second;
    if (x.first + x.second > r) continue;
    if (!si[x.first][x.second])
      dfs(make_pair(x.first, x.second));
    else if (si[x.first][x.second] == 1) {
      cout << "Draw" << '\n';
      exit(0);
    }
  }
  for (int i = 1; i <= min(v.second, m); i++) {
    pair<int, int> x = v;
    x.second -= i;
    x.first += b[i].first;
    x.second += b[i].second;
    if (x.first + x.second > r) continue;
    if (!si[x.first][x.second])
      dfs(make_pair(x.first, x.second));
    else if (si[x.first][x.second] == 1) {
      cout << "Draw" << '\n';
      exit(0);
    }
  }
  si[v.first][v.second] = 2;
}
void bfs() {
  memset(dp, -1, sizeof(dp));
  q.push(make_pair(h, t));
  dp[h][t] = 0;
  while (q.size()) {
    pair<int, int> v = q.front();
    q.pop();
    if (v == help) {
      cout << "Ivan" << '\n';
      cout << dp[0][0] << '\n';
      exit(0);
    }
    for (int i = 1; i <= min(v.first, n); i++) {
      pair<int, int> x = v;
      x.first -= i;
      x.first += a[i].first;
      x.second += a[i].second;
      if (x.first + x.second <= r && dp[x.first][x.second] == -1) {
        dp[x.first][x.second] = dp[v.first][v.second] + 1;
        q.push(x);
      }
    }
    for (int i = 1; i <= min(v.second, m); i++) {
      pair<int, int> x = v;
      x.second -= i;
      x.second += b[i].second;
      x.first += b[i].first;
      if (x.first + x.second <= r && dp[x.first][x.second] == -1) {
        dp[x.first][x.second] = dp[v.first][v.second] + 1;
        q.push(x);
      }
    }
  }
}
int f(pair<int, int> v) {
  if (v.first + v.second > r) return 0;
  if (dp[v.first][v.second] != 0) return dp[v.first][v.second];
  for (int i = 1; i <= min(v.first, n); i++) {
    pair<int, int> x = v;
    x.first -= i;
    x.first += a[i].first;
    x.second += a[i].second;
    dp[v.first][v.second] = max(dp[v.first][v.second], f(x) + 1);
  }
  for (int i = 1; i <= min(v.second, m); i++) {
    pair<int, int> x = v;
    x.second -= i;
    x.first += b[i].first;
    x.second += b[i].second;
    dp[v.first][v.second] = max(dp[v.first][v.second], f(x) + 1);
  }
  return dp[v.first][v.second];
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> h >> t >> r;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  cin >> m;
  for (int i = 1; i <= m; i++) cin >> b[i].first >> b[i].second;
  bfs();
  dfs(make_pair(h, t));
  memset(dp, 0, sizeof(dp));
  cout << "Zmey\n";
  cout << f(make_pair(h, t)) << '\n';
  return 0;
}
