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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.t: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

n.s = b
n.y = j
n.o = i
j.t = n
j.s = n
j.y = b
j.o = b
b.x = j
b.z = j
b.q = n
i.s = n
i.q = n
i.o = j
i.y = b
i.p = b
l.r = b
l.t = b
l.x = b
l.v = b
l.s = n
a.r = b
a.t = b
a.x = b
a.v = b
a.s = n
assert a.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.t: C = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

n.s = b
n.y = j
n.o = i
j.t = n
j.s = n
j.y = b
j.o = b
b.x = j
b.z = j
b.q = n
i.s = n
i.q = n
i.o = j
i.y = b
i.p = b
l.r = b
l.t = b
l.x = b
l.v = b
l.s = n
a.r = b
a.t = b
a.x = b
a.v = b
a.s = n
assert a.s.y.s.txt == "n"