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

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

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

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

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

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

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

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

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

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

k.t = m
k.z = j
d.v = b
d.t = f
d.p = g
d.z = m
f.s = k
f.w = k
f.y = j
m.v = h
m.o = f
m.w = f
m.s = g
l.v = b
l.t = f
l.p = g
l.z = m
b.v = c
b.t = f
b.p = k
b.z = m
g.t = m
g.z = k
j.t = m
j.z = k
h.v = l
h.t = f
h.p = g
h.z = m
c.v = d
c.t = f
c.p = k
c.z = m
assert b.t.w.z.z.z.t.txt == "m"