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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.txt = txt

k = A("k")
b = B("b")
f = C("f")
i = B("i")
g = B("g")
d = B("d")
n = C("n")
e = B("e")

k.t = e
b.p = k
b.r = k
b.z = k
f.x = n
f.u = n
i.p = k
i.r = k
i.z = k
g.p = k
g.r = k
g.z = k
d.p = k
d.r = k
d.z = k
n.x = f
n.u = f
e.p = k
e.r = k
e.z = k
assert b.z.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.txt = txt

k = A("k")
b = B("b")
f = C("f")
i = B("i")
g = B("g")
d = B("d")
n = C("n")
e = B("e")

k.t = e
b.p = k
b.r = k
b.z = k
f.x = n
f.u = n
i.p = k
i.r = k
i.z = k
g.p = k
g.r = k
g.z = k
d.p = k
d.r = k
d.z = k
n.x = f
n.u = f
e.p = k
e.r = k
e.z = k
assert b.z.t.r.txt == "k"