class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
f = C("f")
i = D("i")
a = A("a")
m = D("m")
l = D("l")
c = B("c")
j = B("j")
b = B("b")

d.z = f
d.y = f
d.v = f
d.t = a
g.o = a
g.u = j
g.y = j
g.z = d
f.s = l
f.p = m
i.z = l
i.w = f
i.u = m
i.q = g
a.z = f
a.y = f
a.v = f
a.t = d
m.z = l
m.w = f
m.u = i
m.q = c
l.z = i
l.u = i
l.w = f
l.q = c
c.o = a
c.u = b
c.y = g
c.z = d
j.o = d
j.u = c
j.y = c
j.z = a
b.o = d
b.u = j
b.y = j
b.z = a
assert l.u.z.w.p.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

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

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

d = A("d")
g = B("g")
f = C("f")
i = D("i")
a = A("a")
m = D("m")
l = D("l")
c = B("c")
j = B("j")
b = B("b")

d.z = f
d.y = f
d.v = f
d.t = a
g.o = a
g.u = j
g.y = j
g.z = d
f.s = l
f.p = m
i.z = l
i.w = f
i.u = m
i.q = g
a.z = f
a.y = f
a.v = f
a.t = d
m.z = l
m.w = f
m.u = i
m.q = c
l.z = i
l.u = i
l.w = f
l.q = c
c.o = a
c.u = b
c.y = g
c.z = d
j.o = d
j.u = c
j.y = c
j.z = a
b.o = d
b.u = j
b.y = j
b.z = a
assert l.u.z.w.p.w.s.w.txt == "f"