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

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

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

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

j = A("j")
l = B("l")
e = C("e")
c = D("c")
b = A("b")
f = D("f")

j.q = l
j.s = l
j.x = f
j.w = e
l.t = f
e.r = l
e.o = b
e.y = f
c.w = f
c.s = f
c.z = e
c.v = b
b.q = l
b.s = l
b.x = f
b.w = e
f.w = c
f.s = c
f.z = e
f.v = b
assert c.v.w.r.t.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: B = None
        self.x: D = None
        self.w: C = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
e = C("e")
c = D("c")
b = A("b")
f = D("f")

j.q = l
j.s = l
j.x = f
j.w = e
l.t = f
e.r = l
e.o = b
e.y = f
c.w = f
c.s = f
c.z = e
c.v = b
b.q = l
b.s = l
b.x = f
b.w = e
f.w = c
f.s = c
f.z = e
f.v = b
assert c.v.w.r.t.w.z.txt == "e"