class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

m = A("m")
c = B("c")
e = C("e")
l = A("l")
h = C("h")
k = B("k")
f = C("f")
d = C("d")

m.o = c
m.u = l
c.r = k
e.p = c
e.y = l
e.t = d
l.o = c
l.u = m
h.p = k
h.y = l
h.t = f
k.r = c
f.p = k
f.y = l
f.t = d
d.p = c
d.y = l
d.t = f
assert l.u.o.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

m = A("m")
c = B("c")
e = C("e")
l = A("l")
h = C("h")
k = B("k")
f = C("f")
d = C("d")

m.o = c
m.u = l
c.r = k
e.p = c
e.y = l
e.t = d
l.o = c
l.u = m
h.p = k
h.y = l
h.t = f
k.r = c
f.p = k
f.y = l
f.t = d
d.p = c
d.y = l
d.t = f
assert l.u.o.r.r.r.r.txt == "c"