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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.z: D = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

b.p = n
b.s = n
b.o = c
b.y = c
i.r = n
c.q = b
c.u = b
c.t = b
c.z = a
c.o = n
a.q = i
n.o = c
n.s = c
assert n.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.o: C = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.z: D = None
        self.o: E = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

b.p = n
b.s = n
b.o = c
b.y = c
i.r = n
c.q = b
c.u = b
c.t = b
c.z = a
c.o = n
a.q = i
n.o = c
n.s = c
assert n.o.o.o.txt == "c"