#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define LONG_INF 100000000000000 vector vertex[200000]; int main() { iostream::sync_with_stdio(false); int a, b, c, d; cin >> a >> b >> c >> d; if (c != 0) { if (b != c && a != c) { for (int i = 0;i < c - 1;++i) { vertex[i + 2].push_back(i + 3); } vertex[0].push_back(2); vertex[1].push_back(2); } else if (b == c) { for (int i = 0;i < c;i++) { vertex[i].push_back(i + 1); } c--; a--;b--; } else if (a == c) { vertex[1].push_back(0); for (int i = 0;i < c - 1;++i) { if (i == 0) { vertex[0].push_back(2); } else { vertex[i + 1].push_back(i + 2); } } c--; a--;b--; } } a--;b--; a -= c;b -= c; for (int i = c + 2;i < c + 2 + a;++i) { vertex[0].push_back(i); } for (int i = c + 2 + a;i < c + 2 + a + b;++i) { vertex[1].push_back(i); } vector> ans; int now = 0; int wow_max = 0; while (true) { if (now == 100000) break; for (int i = 0;i < vertex[now].size();++i) { ans.push_back(make_pair(now, vertex[now][i])); wow_max = max(wow_max, vertex[now][i]); } now++; } if (ans.size() <= d) { cout << wow_max << " " << ans.size() << endl; REP(i, ans.size()) { cout << ans[i].first << " " << ans[i].second << endl; } return 0; } else cout << "-1" << endl; }