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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

m = A("m")
n = B("n")
h = C("h")
j = D("j")
g = E("g")
c = E("c")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.w: C = None
        self.txt = txt

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

m = A("m")
n = B("n")
h = C("h")
j = D("j")
g = E("g")
c = E("c")

m.s = g
m.v = h
m.w = h
m.z = h
m.y = h
n.s = h
n.p = h
n.r = m
h.s = j
h.x = n
j.r = n
j.s = m
j.w = h
g.t = j
g.r = j
g.u = j
c.t = j
c.r = j
c.u = j
assert m.s.u.r.p.s.txt == "j"