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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.s: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: A = None
        self.s: A = None
        self.y: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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