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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
j = C("j")
e = D("e")
d = E("d")
l = C("l")
i = E("i")
k = C("k")

n.x = d
n.q = i
n.s = i
b.p = l
b.x = n
j.v = e
j.w = e
j.p = l
j.z = i
e.p = i
e.w = d
e.s = b
d.w = j
d.p = e
d.x = n
d.o = n
l.v = e
l.w = e
l.p = k
l.z = i
i.w = l
i.p = e
i.x = n
i.o = n
k.v = e
k.w = e
k.p = j
k.z = i
assert k.p.z.p.s.x.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: E = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.z: E = None
        self.w: D = None
        self.txt = txt

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

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

n = A("n")
b = B("b")
j = C("j")
e = D("e")
d = E("d")
l = C("l")
i = E("i")
k = C("k")

n.x = d
n.q = i
n.s = i
b.p = l
b.x = n
j.v = e
j.w = e
j.p = l
j.z = i
e.p = i
e.w = d
e.s = b
d.w = j
d.p = e
d.x = n
d.o = n
l.v = e
l.w = e
l.p = k
l.z = i
i.w = l
i.p = e
i.x = n
i.o = n
k.v = e
k.w = e
k.p = j
k.z = i
assert k.p.z.p.s.x.x.w.txt == "j"