{$N+}

type
  PT = ^T;
  T = record
    v: Comp;
    next: PT;
  end;

var
  p1, p2, p3, z: Comp;
  i, count, N: Integer;
  p: PT;
  head: T;
  f: Text;

procedure Add(n: Comp);
var
  p, q: PT;
begin
  p := head.next;
  while p <> nil do
    if Int(n / p^.v) * p^.v = n then exit else p := p^.next;
  p := @head;
  while (p^.next <> nil) and (n > p^.next^.v) do p := p^.next;
  Inc(count);
  New(q);
  q^.v := n;
  q^.next := p^.next;
  p^.next := q;
end;

begin
  Readln(p1, p2, p3, N);
  head.v := 0;
  head.next := nil;
  count := 1; z := 1;
  for i := 1 to N do begin
    Add(z*p1);
    Add(z*p2);
    Add(z*p3);
    z := head.next^.v;
    p := head.next;
    head.next := p^.next;
    Dispose(p);
    Dec(count);
    {Write(z:0:0, ' ');}
  end;
  {Writeln; Writeln(count);
  p := head.next;
  while p <> nil do begin
    Write(p^.v:9:0, ' ');
    p := p^.next;
  end;
  Writeln;    }
  Writeln(z:0:0);
end.

