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

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

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

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

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

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

a.z = j
a.v = j
c.w = l
n.x = l
n.t = j
l.w = j
l.u = c
j.p = a
i.x = l
i.t = j
assert c.w.w.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

a.z = j
a.v = j
c.w = l
n.x = l
n.t = j
l.w = j
l.u = c
j.p = a
i.x = l
i.t = j
assert c.w.w.p.v.txt == "j"