class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.t: B = None
        self.y: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
g = C("g")
m = E("m")

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

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

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

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

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

n = A("n")
a = B("a")
h = C("h")
i = D("i")
d = E("d")
g = C("g")
m = E("m")

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