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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.p: C = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

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

a.q = b
a.p = i
l.v = n
j.w = a
j.u = b
j.p = b
j.t = n
j.v = n
n.r = l
n.w = l
i.o = l
i.p = n
b.w = a
b.u = j
b.p = j
b.t = n
b.v = n
assert j.p.v.r.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.p: C = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

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

a.q = b
a.p = i
l.v = n
j.w = a
j.u = b
j.p = b
j.t = n
j.v = n
n.r = l
n.w = l
i.o = l
i.p = n
b.w = a
b.u = j
b.p = j
b.t = n
b.v = n
assert j.p.v.r.v.w.txt == "l"