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

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

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

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

k = A("k")
a = B("a")
n = C("n")
g = D("g")
j = D("j")
b = A("b")
i = B("i")
f = A("f")
e = A("e")

k.z = a
k.w = a
k.y = n
k.u = b
a.o = i
n.o = k
n.v = a
g.t = j
g.z = j
g.v = n
g.q = n
j.t = g
j.z = g
j.v = n
j.q = n
b.z = a
b.w = i
b.y = n
b.u = f
i.o = a
f.z = a
f.w = a
f.y = n
f.u = k
e.z = a
e.w = a
e.y = n
e.u = f
assert n.v.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.y: C = None
        self.u: A = None
        self.txt = txt

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

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

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

k = A("k")
a = B("a")
n = C("n")
g = D("g")
j = D("j")
b = A("b")
i = B("i")
f = A("f")
e = A("e")

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