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

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

i = A("i")
l = B("l")
b = B("b")
j = B("j")
a = B("a")
f = A("f")
h = B("h")
e = B("e")
g = A("g")

i.z = h
i.t = e
l.r = e
b.r = h
j.r = a
a.r = h
f.z = b
f.t = b
h.r = l
e.r = b
g.z = h
g.t = l
assert f.z.r.r.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: B = None
        self.txt = txt

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

i = A("i")
l = B("l")
b = B("b")
j = B("j")
a = B("a")
f = A("f")
h = B("h")
e = B("e")
g = A("g")

i.z = h
i.t = e
l.r = e
b.r = h
j.r = a
a.r = h
f.z = b
f.t = b
h.r = l
e.r = b
g.z = h
g.t = l
assert f.z.r.r.r.r.r.r.r.txt == "e"