{$apptype console}
{$o+,s-,q-,r-}

uses testlib, SysUtils, Math;

const maxN = 50;
      infinity = 1000000000;

var f, c, cc, w: array[1..2*maxN, 1..2*maxN]of longint;
    deg: array[1..2*maxN]of longint;
    u: array[1..2*maxN]of boolean;
    cn: longint;

function dfs(i, t, d: longint): longint;
var j, x: longint;
begin
  if i = t then begin
    result := d;
    exit;
  end;

  u[i] := true;
  for j := 1 to cn do
    if (c[i, j] > f[i, j]) and (not u[j]) then begin
      x := dfs(j, t, min(d, c[i, j] - f[i, j]));
      if x > 0 then begin
        inc(f[i, j], x);
        dec(f[j, i], x);
        result := x;
        exit;
      end;
    end;

  result := 0;
end;

function flow(s, t: longint): longint;
var x: longint;
begin
  fillchar(f, sizeof(f), 0);
  result := 0;
  while true do begin
    fillchar(u, sizeof(u), false);
    x := dfs(s, t, infinity);
    if x = 0 then
      exit;
    result := result + x;
  end;
end;

var adelta, akappa, alambda, delta, kappa, lambda: longint;
    j, n, m, jn, a, b, i: longint;

begin
  adelta := inf.readlongint;
  akappa := inf.readlongint;
  alambda := inf.readlongint;

  n := ouf.readlongint;
  m := ouf.readlongint;
  jn := ans.readlongint;

  if (n = 0) and (m <> 0) then
    quit(_wa, 'n = 0, but m != 0');
  if (n = 0) and (m = 0) then begin
    if jn = 0 then
      quit(_ok, 'no such graph')
    else
      quit(_wa, 'graph exists, but solution has not found it');
  end;
  
  if (n < 1) or (n > maxN) then
    quit(_wa, format('wrong n: %d', [n]));
  if (m < 0) or (m > n * n) then
    quit(_wa, format('wrong m: %d', [m]));

  fillchar(w, sizeof(w), 0);
  fillchar(deg, sizeof(deg), 0);
  for i := 1 to m do begin
    a := ouf.readlongint;
    b := ouf.readlongint;
    if (a < 1) or (a > n) or (b < 1) or (b > n) then
      quit(_wa, 'wrong number of vertex');
    if a = b then
      quit(_wa, 'graph contains loop');
    if w[a, b] = 1 then
      quit(_wa, 'graph contains parallel edges');
    w[a, b] := 1;
    w[b, a] := 1;
    inc(deg[a]);
    inc(deg[b]);
  end;

  delta := n + 1;
  for i := 1 to n do
    if deg[i] < delta then
      delta := deg[i];
  if delta <> adelta then
    quit(_wa, 'wrong delta');

  lambda := m + 1;
  cn := n;
  for i := 2 to n do begin
    c := w;
    a := flow(1, i);
    if a < lambda then
      lambda := a;
  end;
  if n = 1 then
    lambda := 0;
  if lambda <> alambda then
    quit(_wa, 'wrong lambda');

  fillchar(cc, sizeof(cc), 0);
  for i := 1 to n do
    cc[i, i + n] := 1;
  for i := 1 to n do
    for j := 1 to n do
      if w[i, j] = 1 then
        cc[i + n, j] := infinity;

  kappa := n + 1;
  cn := 2 * n;
  for i := 1 to n do 
    for j := i + 1 to n do begin
      c := cc;
      a := flow(i + n, j);
      if a < kappa then
        kappa := a;
    end;
  if (n * (n - 1)) div 2 = m then
    kappa := n - 1;
  if kappa <> akappa then
    quit(_wa, format('wrong kappa: %d instead of %d', [kappa, akappa]));

  if jn = 0 then
    quit(_fail, '');
  quit(_ok, format('d = %d, k = %d, l = %d', [delta, kappa, lambda]));
end.
