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

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

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

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

m = A("m")
n = B("n")
j = C("j")
h = D("h")
b = C("b")
f = D("f")
i = A("i")
a = D("a")
d = C("d")
k = B("k")

m.t = k
m.w = j
n.s = f
n.z = k
n.y = m
j.y = m
j.v = i
h.y = f
h.o = k
b.y = i
b.v = i
f.y = a
f.o = k
i.t = k
i.w = j
a.y = h
a.o = n
d.y = i
d.v = m
k.s = h
k.z = n
k.y = i
assert a.y.o.z.y.t.s.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: C = None
        self.txt = txt

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

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

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

m = A("m")
n = B("n")
j = C("j")
h = D("h")
b = C("b")
f = D("f")
i = A("i")
a = D("a")
d = C("d")
k = B("k")

m.t = k
m.w = j
n.s = f
n.z = k
n.y = m
j.y = m
j.v = i
h.y = f
h.o = k
b.y = i
b.v = i
f.y = a
f.o = k
i.t = k
i.w = j
a.y = h
a.o = n
d.y = i
d.v = m
k.s = h
k.z = n
k.y = i
assert a.y.o.z.y.t.s.o.y.t.txt == "k"