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

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

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

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

m = A("m")
j = B("j")
k = C("k")
a = D("a")
d = B("d")
n = C("n")
g = C("g")
l = D("l")
e = C("e")

m.o = g
m.u = n
m.r = d
j.s = d
j.o = l
j.x = a
j.z = m
k.q = n
k.z = d
k.p = l
a.y = g
a.s = l
a.z = n
d.s = j
d.o = l
d.x = a
d.z = m
n.q = e
n.z = j
n.p = a
g.q = e
g.z = d
g.p = a
l.y = n
l.s = a
l.z = k
e.q = g
e.z = j
e.p = a
assert m.o.z.s.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
k = C("k")
a = D("a")
d = B("d")
n = C("n")
g = C("g")
l = D("l")
e = C("e")

m.o = g
m.u = n
m.r = d
j.s = d
j.o = l
j.x = a
j.z = m
k.q = n
k.z = d
k.p = l
a.y = g
a.s = l
a.z = n
d.s = j
d.o = l
d.x = a
d.z = m
n.q = e
n.z = j
n.p = a
g.q = e
g.z = d
g.p = a
l.y = n
l.s = a
l.z = k
e.q = g
e.z = j
e.p = a
assert m.o.z.s.o.y.txt == "n"