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

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

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

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

l = A("l")
j = B("j")
i = C("i")
c = D("c")
f = A("f")
a = D("a")
g = C("g")

l.o = j
l.r = a
j.t = g
j.z = c
i.w = j
i.v = j
i.o = a
c.u = l
c.z = g
c.w = g
c.t = a
f.o = j
f.r = a
a.u = f
a.z = g
a.w = g
a.t = c
g.w = j
g.v = j
g.o = a
assert l.o.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.txt = txt

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

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

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

l = A("l")
j = B("j")
i = C("i")
c = D("c")
f = A("f")
a = D("a")
g = C("g")

l.o = j
l.r = a
j.t = g
j.z = c
i.w = j
i.v = j
i.o = a
c.u = l
c.z = g
c.w = g
c.t = a
f.o = j
f.r = a
a.u = f
a.z = g
a.w = g
a.t = c
g.w = j
g.v = j
g.o = a
assert l.o.z.t.txt == "a"