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

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

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

i = A("i")
n = B("n")
l = C("l")
c = A("c")
h = B("h")
k = A("k")
j = B("j")
d = B("d")
b = C("b")
a = C("a")

i.t = a
i.z = h
n.o = b
l.r = b
l.o = n
l.t = d
c.t = a
c.z = d
h.o = a
k.t = a
k.z = h
j.o = a
d.o = l
b.r = l
b.o = h
b.t = h
a.r = l
a.o = h
a.t = h
assert b.t.o.r.r.r.t.o.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
l = C("l")
c = A("c")
h = B("h")
k = A("k")
j = B("j")
d = B("d")
b = C("b")
a = C("a")

i.t = a
i.z = h
n.o = b
l.r = b
l.o = n
l.t = d
c.t = a
c.z = d
h.o = a
k.t = a
k.z = h
j.o = a
d.o = l
b.r = l
b.o = h
b.t = h
a.r = l
a.o = h
a.t = h
assert b.t.o.r.r.r.t.o.r.r.txt == "l"