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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.u: D = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

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

b.z = h
b.u = a
j.z = b
h.s = b
h.p = a
m.w = b
m.q = g
m.x = g
m.v = h
a.y = b
a.r = b
a.u = m
a.q = h
a.t = h
g.w = b
g.q = m
g.x = m
g.v = h
assert g.v.p.u.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.u: D = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

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

b.z = h
b.u = a
j.z = b
h.s = b
h.p = a
m.w = b
m.q = g
m.x = g
m.v = h
a.y = b
a.r = b
a.u = m
a.q = h
a.t = h
g.w = b
g.q = m
g.x = m
g.v = h
assert g.v.p.u.v.s.txt == "b"