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

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

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

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

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

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

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

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

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

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

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

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

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