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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.t: C = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
b = D("b")
g = E("g")
a = E("a")

j.v = h
j.z = e
j.t = e
j.p = a
j.s = b
e.o = g
h.x = g
b.q = j
b.p = h
g.w = h
g.t = h
g.p = h
g.z = j
g.s = j
a.w = h
a.t = h
a.p = h
a.z = j
a.s = j
assert h.x.w.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: B = None
        self.p: E = None
        self.s: D = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: A = None
        self.t: C = None
        self.s: A = None
        self.p: C = None
        self.txt = txt

j = A("j")
e = B("e")
h = C("h")
b = D("b")
g = E("g")
a = E("a")

j.v = h
j.z = e
j.t = e
j.p = a
j.s = b
e.o = g
h.x = g
b.q = j
b.p = h
g.w = h
g.t = h
g.p = h
g.z = j
g.s = j
a.w = h
a.t = h
a.p = h
a.z = j
a.s = j
assert h.x.w.x.p.txt == "h"