class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: C = None
        self.u: D = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

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

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

n.q = d
n.y = i
n.p = i
n.u = l
n.w = l
c.r = d
c.v = d
c.p = i
i.w = c
i.q = d
i.t = d
l.w = c
d.u = c
assert n.q.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: C = None
        self.u: D = None
        self.w: D = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: E = None
        self.t: E = None
        self.txt = txt

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

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

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

n.q = d
n.y = i
n.p = i
n.u = l
n.w = l
c.r = d
c.v = d
c.p = i
i.w = c
i.q = d
i.t = d
l.w = c
d.u = c
assert n.q.u.r.u.txt == "c"