class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

i.w = c
i.x = c
n.y = i
n.o = c
l.o = b
l.q = c
l.w = i
l.s = i
b.t = c
c.r = i
c.v = l
c.p = l
assert n.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

i.w = c
i.x = c
n.y = i
n.o = c
l.o = b
l.q = c
l.w = i
l.s = i
b.t = c
c.r = i
c.v = l
c.p = l
assert n.o.p.q.txt == "c"