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

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

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

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

b = A("b")
e = B("e")
j = C("j")
i = D("i")
m = B("m")
g = A("g")
a = B("a")
k = C("k")
h = C("h")
c = C("c")

b.o = i
e.w = j
e.z = g
e.y = a
e.u = m
j.q = i
j.t = e
j.y = a
i.s = b
i.y = b
i.z = m
m.w = h
m.z = b
m.y = a
m.u = a
g.o = i
a.w = h
a.z = g
a.y = m
a.u = m
k.q = i
k.t = m
k.y = m
h.q = i
h.t = e
h.y = e
c.q = i
c.t = e
c.y = m
assert b.o.z.w.y.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

b = A("b")
e = B("e")
j = C("j")
i = D("i")
m = B("m")
g = A("g")
a = B("a")
k = C("k")
h = C("h")
c = C("c")

b.o = i
e.w = j
e.z = g
e.y = a
e.u = m
j.q = i
j.t = e
j.y = a
i.s = b
i.y = b
i.z = m
m.w = h
m.z = b
m.y = a
m.u = a
g.o = i
a.w = h
a.z = g
a.y = m
a.u = m
k.q = i
k.t = m
k.y = m
h.q = i
h.t = e
h.y = e
c.q = i
c.t = e
c.y = m
assert b.o.z.w.y.u.u.y.txt == "m"