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

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

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

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

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

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

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

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

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

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

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

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

j.w = c
j.y = l
j.u = l
j.s = k
j.t = n
l.y = c
i.p = l
c.u = n
k.p = j
k.v = l
n.p = l
assert c.u.p.y.u.txt == "n"