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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.p: D = None
        self.txt = txt

l = A("l")
a = B("a")
d = C("d")
i = D("i")
g = D("g")

l.w = d
l.o = a
l.v = g
a.x = d
a.u = i
d.t = g
d.z = l
d.p = l
d.w = a
i.y = g
i.p = g
i.w = d
g.y = i
g.p = i
g.w = d
assert i.y.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: B = None
        self.v: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: C = None
        self.p: D = None
        self.txt = txt

l = A("l")
a = B("a")
d = C("d")
i = D("i")
g = D("g")

l.w = d
l.o = a
l.v = g
a.x = d
a.u = i
d.t = g
d.z = l
d.p = l
d.w = a
i.y = g
i.p = g
i.w = d
g.y = i
g.p = i
g.w = d
assert i.y.w.t.txt == "g"