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

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

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

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

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

l = A("l")
n = B("n")
c = C("c")
d = D("d")
a = E("a")
g = C("g")
j = E("j")
k = B("k")

l.s = g
l.w = a
l.u = d
l.p = c
n.o = j
n.u = d
n.q = k
c.u = l
d.r = c
d.z = j
a.z = l
a.s = n
a.p = k
g.u = l
j.z = l
j.s = n
j.p = k
k.o = a
k.u = d
k.q = n
assert a.s.u.z.s.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: E = None
        self.u: D = None
        self.p: C = None
        self.txt = txt

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

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

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

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

l = A("l")
n = B("n")
c = C("c")
d = D("d")
a = E("a")
g = C("g")
j = E("j")
k = B("k")

l.s = g
l.w = a
l.u = d
l.p = c
n.o = j
n.u = d
n.q = k
c.u = l
d.r = c
d.z = j
a.z = l
a.s = n
a.p = k
g.u = l
j.z = l
j.s = n
j.p = k
k.o = a
k.u = d
k.q = n
assert a.s.u.z.s.q.q.q.txt == "k"