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

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

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

g = A("g")
c = B("c")
b = C("b")
n = C("n")
j = A("j")
f = C("f")
i = C("i")

g.p = c
g.r = c
g.z = f
c.p = j
b.o = g
b.u = g
b.x = j
n.o = g
n.x = j
n.u = j
j.p = c
j.r = c
j.z = i
f.o = g
f.x = j
f.u = j
i.o = j
i.x = j
i.u = j
assert n.u.z.o.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

g = A("g")
c = B("c")
b = C("b")
n = C("n")
j = A("j")
f = C("f")
i = C("i")

g.p = c
g.r = c
g.z = f
c.p = j
b.o = g
b.u = g
b.x = j
n.o = g
n.x = j
n.u = j
j.p = c
j.r = c
j.z = i
f.o = g
f.x = j
f.u = j
i.o = j
i.x = j
i.u = j
assert n.u.z.o.z.u.z.txt == "i"