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

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

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

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

l = A("l")
k = B("k")
j = C("j")
g = D("g")
m = C("m")
b = C("b")
a = D("a")
c = A("c")
d = B("d")

l.z = k
l.o = c
k.y = d
k.z = j
k.u = j
j.x = d
j.w = b
j.v = c
j.z = a
g.r = a
g.y = m
g.s = l
m.x = k
m.w = b
m.v = c
m.z = g
b.x = k
b.w = m
b.v = l
b.z = a
a.r = g
a.y = j
a.s = c
c.z = k
c.o = l
d.y = k
d.z = j
d.u = m
assert j.w.z.s.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: A = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
j = C("j")
g = D("g")
m = C("m")
b = C("b")
a = D("a")
c = A("c")
d = B("d")

l.z = k
l.o = c
k.y = d
k.z = j
k.u = j
j.x = d
j.w = b
j.v = c
j.z = a
g.r = a
g.y = m
g.s = l
m.x = k
m.w = b
m.v = c
m.z = g
b.x = k
b.w = m
b.v = l
b.z = a
a.r = g
a.y = j
a.s = c
c.z = k
c.o = l
d.y = k
d.z = j
d.u = m
assert j.w.z.s.z.u.z.txt == "a"