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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

j = A("j")
b = B("b")
h = C("h")
l = D("l")
i = A("i")
d = C("d")
m = A("m")
e = B("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: C = None
        self.x: A = None
        self.txt = txt

j = A("j")
b = B("b")
h = C("h")
l = D("l")
i = A("i")
d = C("d")
m = A("m")
e = B("e")

j.z = l
j.q = e
j.x = e
j.o = h
b.u = e
b.w = e
b.t = d
b.y = h
h.t = j
h.q = j
h.u = l
h.w = l
l.s = i
l.u = d
l.x = j
i.z = l
i.q = e
i.o = d
i.x = b
d.t = j
d.q = m
d.u = l
d.w = l
m.z = l
m.q = e
m.x = e
m.o = h
e.u = b
e.w = b
e.t = d
e.y = h
assert m.x.y.u.x.o.txt == "h"