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

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

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

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

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

e.z = i
e.v = i
e.u = l
j.y = a
j.q = a
f.w = n
f.t = k
f.x = a
f.o = e
k.z = i
k.o = f
n.z = i
n.o = f
l.z = k
l.v = k
l.u = e
m.w = n
m.t = k
m.x = a
m.o = l
a.y = j
a.q = j
i.z = n
i.o = m
assert n.z.z.z.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.u: A = None
        self.txt = txt

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

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

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

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

e.z = i
e.v = i
e.u = l
j.y = a
j.q = a
f.w = n
f.t = k
f.x = a
f.o = e
k.z = i
k.o = f
n.z = i
n.o = f
l.z = k
l.v = k
l.u = e
m.w = n
m.t = k
m.x = a
m.o = l
a.y = j
a.q = j
i.z = n
i.o = m
assert n.z.z.z.o.t.txt == "k"