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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.t: B = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

n.s = d
n.q = m
n.p = m
n.w = e
c.q = n
c.w = n
m.o = e
k.r = e
k.q = c
k.t = c
k.z = d
k.s = d
e.s = k
e.x = m
e.v = f
d.r = e
d.q = c
d.t = f
d.z = k
d.s = k
f.q = n
f.w = n
assert m.o.v.w.s.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: C = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: B = None
        self.t: B = None
        self.z: D = None
        self.s: D = None
        self.txt = txt

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

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

n.s = d
n.q = m
n.p = m
n.w = e
c.q = n
c.w = n
m.o = e
k.r = e
k.q = c
k.t = c
k.z = d
k.s = d
e.s = k
e.x = m
e.v = f
d.r = e
d.q = c
d.t = f
d.z = k
d.s = k
f.q = n
f.w = n
assert m.o.v.w.s.s.z.txt == "d"