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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.y: A = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
h = D("h")
m = E("m")
a = A("a")
e = B("e")
n = D("n")
d = E("d")

b.x = a
b.y = a
k.y = m
i.y = n
i.q = n
i.v = e
i.z = m
i.r = d
h.q = n
h.s = d
h.y = b
h.u = m
h.w = a
m.w = d
m.v = d
m.y = n
m.t = i
a.x = b
a.y = b
e.y = d
n.q = h
n.s = d
n.u = d
n.y = b
n.w = a
d.w = m
d.v = m
d.y = n
d.t = i
assert h.u.v.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: E = None
        self.y: A = None
        self.u: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

b = A("b")
k = B("k")
i = C("i")
h = D("h")
m = E("m")
a = A("a")
e = B("e")
n = D("n")
d = E("d")

b.x = a
b.y = a
k.y = m
i.y = n
i.q = n
i.v = e
i.z = m
i.r = d
h.q = n
h.s = d
h.y = b
h.u = m
h.w = a
m.w = d
m.v = d
m.y = n
m.t = i
a.x = b
a.y = b
e.y = d
n.q = h
n.s = d
n.u = d
n.y = b
n.w = a
d.w = m
d.v = m
d.y = n
d.t = i
assert h.u.v.w.y.txt == "n"