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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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