import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto rd = readln.split.to!(int[]), a = rd[0], b = rd[1], c = rd[2], d = rd[3]; auto v0 = a-c, v1 = b-c, v2 = c, v = a+b-c; if (v2 == 0) { auto e = v0-1 + v1-1; if (d < e) { writeln(-1); return; } writeln(v, " ", e); foreach (i; 0..v0-1) writeln(0, " ", i+2); foreach (i; 0..v1-1) writeln(1, " ", i+v1+1); } else if (v0 > 0 && v1 > 0) { auto e = v0-1 + v1-1 + v2+1; if (d < e) { writeln(-1); return; } writeln(v, " ", e); foreach (i; 0..v0-1) writeln(0, " ", i+2); foreach (i; 0..v1-1) writeln(1, " ", i+v0+1); writeln(0, " ", v0+v1); writeln(1, " ", v0+v1); foreach (i; 0..v2-1) writeln(v0+v1, " ", i+v0+v1+1); } else if (v0 == 0 && v1 > 0) { auto e = v2-1 + v1-1 + 1; if (d < e) { writeln(-1); return; } writeln(v, " ", e); writeln(1, " ", 0); foreach (i; 0..v2-1) writeln(0, " ", i+2); foreach (i; 0..v1-1) writeln(1, " ", i+v2+1); } else if (v0 > 0 && v1 == 0) { auto e = v2-1 + v0-1 + 1; if (d < e) { writeln(-1); return; } writeln(v, " ", e); writeln(0, " ", 1); foreach (i; 0..v2-1) writeln(1, " ", i+2); foreach (i; 0..v0-1) writeln(0, " ", i+v2+1); } else { auto e = v2+2; if (d < e) { writeln(-1); return; } writeln(v, " ", e); writeln(0, " ", 1); writeln(1, " ", 0); foreach (i; 0..v2) writeln(0, " ", i+2); } }