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

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
d = B("d")
c = C("c")
l = D("l")
b = E("b")
n = B("n")

k.s = b
k.o = c
k.u = c
k.x = l
k.q = l
d.x = n
d.z = n
d.s = l
c.p = n
c.q = l
l.x = b
l.s = b
l.t = n
l.u = d
b.p = k
b.s = n
b.t = c
b.v = c
b.q = c
n.x = d
n.z = d
n.s = l
assert k.u.p.s.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.u: C = None
        self.x: D = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
d = B("d")
c = C("c")
l = D("l")
b = E("b")
n = B("n")

k.s = b
k.o = c
k.u = c
k.x = l
k.q = l
d.x = n
d.z = n
d.s = l
c.p = n
c.q = l
l.x = b
l.s = b
l.t = n
l.u = d
b.p = k
b.s = n
b.t = c
b.v = c
b.q = c
n.x = d
n.z = d
n.s = l
assert k.u.p.s.t.x.txt == "d"