{$APPTYPE CONSOLE}
uses
  SysUtils, testlib;
var
  i, n, len : longint;
  x, d, dd, xx : int64;
  a, b : array [1..200000] of longint;

procedure sort(l, r : longint);
 var
  i, j, k, q : longint;

 begin
   if (r <= l) then
     exit;
   k := (l + r) div 2;
   i := l;
   j := k + 1;
   sort(l, k);
   sort(j, r);
   for q := l to r do
     if (j > r) or ((i <= k) and (a[i] <= a[j])) then begin
       b[q] := a[i];
       inc(i);
     end else begin
       b[q] := a[j];
       inc(j);
     end;
   for q := l to r do
     a[q] := b[q];
 end;

Begin
  n := inf.ReadLongint;
  for i := 1 to 2 * n do
    a[i] := inf.ReadLongint;
  sort(1, 2 * n);
  x := ouf.ReadLongint;
  d := ouf.ReadLongint;
  dd := d;
  xx := x;
  if (d < 0) then begin
    x := x + (n - 1) * d;
    d := -d;
  end;
  len := 0;
  for i := 1 to 2 * n do
    if (a[i] = x) then begin
      inc(len);
      inc(x, d);
    end;
  if (len < n) then
    quit(_wa, intToStr(xx) + ' ' + intToStr(dd) + ' is not an answer');
  quit(_ok, intToStr(xx) + ' ' + intToStr(dd));
End.