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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
n = D("n")
k = E("k")
l = E("l")
j = D("j")
e = E("e")

g.z = n
g.o = d
d.x = g
d.v = g
d.z = k
d.r = b
d.p = l
b.t = d
n.z = g
n.y = b
n.w = b
n.p = d
k.q = g
l.q = g
j.z = g
j.y = b
j.w = b
j.p = d
e.q = g
assert g.o.r.t.p.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
n = D("n")
k = E("k")
l = E("l")
j = D("j")
e = E("e")

g.z = n
g.o = d
d.x = g
d.v = g
d.z = k
d.r = b
d.p = l
b.t = d
n.z = g
n.y = b
n.w = b
n.p = d
k.q = g
l.q = g
j.z = g
j.y = b
j.w = b
j.p = d
e.q = g
assert g.o.r.t.p.q.z.txt == "n"