(define (solve f0 f1 n) (define *memo* (make-hash-table)) (define (f k) (if (hash-table-exists? *memo* k) (hash-table-get *memo* k) (cond ((= k 0) f0) ((= k 1) f1) (else (hash-table-put! *memo* k (logxor (f (- k 1)) (f (- k 2)))) (hash-table-get *memo* k))))) (f n)) (print (apply solve (map string->number (string-split (read-line) #\space))))