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

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

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

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

e = A("e")
i = B("i")
m = C("m")
a = D("a")
n = D("n")
k = A("k")
d = B("d")
f = A("f")

e.z = k
e.x = i
e.u = m
i.t = f
i.o = m
i.y = m
m.u = f
m.o = a
m.x = d
m.v = k
a.z = e
a.t = f
n.z = k
n.t = f
k.z = f
k.x = d
k.u = m
d.t = f
d.o = m
d.y = m
f.z = e
f.x = i
f.u = m
assert m.u.u.x.o.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
m = C("m")
a = D("a")
n = D("n")
k = A("k")
d = B("d")
f = A("f")

e.z = k
e.x = i
e.u = m
i.t = f
i.o = m
i.y = m
m.u = f
m.o = a
m.x = d
m.v = k
a.z = e
a.t = f
n.z = k
n.t = f
k.z = f
k.x = d
k.u = m
d.t = f
d.o = m
d.y = m
f.z = e
f.x = i
f.u = m
assert m.u.u.x.o.x.y.txt == "m"