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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

k = A("k")
b = B("b")
e = C("e")
h = D("h")
n = B("n")
a = B("a")
f = D("f")
m = A("m")

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

k = A("k")
b = B("b")
e = C("e")
h = D("h")
n = B("n")
a = B("a")
f = D("f")
m = A("m")

k.t = e
k.o = e
b.z = f
b.v = m
b.y = e
b.s = e
e.r = a
h.o = e
h.z = e
h.t = k
h.r = m
n.z = h
n.v = k
n.y = e
n.s = e
a.z = f
a.v = k
a.y = e
a.s = e
f.o = e
f.z = e
f.t = m
f.r = k
m.t = e
m.o = e
assert m.o.r.v.t.txt == "e"