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.y: A = None
        self.t: D = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
e = C("e")
n = D("n")

b.q = e
b.s = n
i.u = e
i.y = b
i.t = n
e.z = n
e.v = i
e.o = i
e.y = i
n.x = e
n.u = b
n.y = i
assert i.y.q.o.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.y: A = None
        self.t: D = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
e = C("e")
n = D("n")

b.q = e
b.s = n
i.u = e
i.y = b
i.t = n
e.z = n
e.v = i
e.o = i
e.y = i
n.x = e
n.u = b
n.y = i
assert i.y.q.o.txt == "i"