def lower_bound(z): return min([car(z), cdr(z)])
def upper_bound(z): return max([car(z), cdr(z)])
def x_point(point): return car(point)
def start_segment(segment): return car(segment)
def list_ref(items, n): if (n == 0): return car(items) return list_ref(cdr(items), n - 1)
def left_top(rectangle): return car(rectangle)
def append(list1, list2): if null(list1): return list2 return cons(car(list1), append(cdr(list1), list2))
def numer(x): return car(x)
from util_pair import cons, car, cdr, list, print_list x = cons(1, cons(2, cons(3, cons(4, None)))) print_list(x) one_through_four = list([1, 2, 3, 4]) print_list(one_through_four) print(car(one_through_four)) print_list(cdr(one_through_four)) print(car(cdr(one_through_four))) print_list(cons(10, one_through_four)) print_list(cons(5, one_through_four))
def numer(x): g = gcd(car(x), cdr(x)) return int(car(x) / g)
def denom(x): g = gcd(car(x), cdr(x)) return int(cdr(x) / g)