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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

a.x = b
a.p = k
a.w = k
a.u = l
k.x = b
k.v = n
k.u = f
b.t = k
l.y = b
l.u = d
l.s = k
l.o = n
l.q = a
d.z = k
d.y = k
d.q = a
f.z = k
f.y = k
f.q = a
n.y = b
n.u = d
n.s = k
n.o = l
n.q = a
assert l.o.q.u.u.q.x.t.txt == "k"