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

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

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

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

i = A("i")
b = B("b")
j = C("j")
l = D("l")

i.q = j
i.s = l
b.u = j
b.s = i
b.w = i
b.z = l
j.r = b
j.x = b
j.o = l
l.q = i
l.s = j
assert i.s.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: D = None
        self.txt = txt

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

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

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

i = A("i")
b = B("b")
j = C("j")
l = D("l")

i.q = j
i.s = l
b.u = j
b.s = i
b.w = i
b.z = l
j.r = b
j.x = b
j.o = l
l.q = i
l.s = j
assert i.s.q.q.txt == "j"