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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

a = A("a")
n = B("n")
c = C("c")
d = D("d")
i = E("i")
e = F("e")
g = B("g")
l = C("l")

a.w = d
n.t = g
n.p = g
n.z = d
c.z = n
c.o = d
c.q = a
c.s = a
d.o = i
i.z = e
i.q = e
i.o = c
i.w = a
i.u = a
i.y = d
e.p = n
g.t = n
g.p = n
g.z = d
l.z = g
l.o = d
l.q = a
l.s = a
assert d.o.u.w.o.o.z.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

a = A("a")
n = B("n")
c = C("c")
d = D("d")
i = E("i")
e = F("e")
g = B("g")
l = C("l")

a.w = d
n.t = g
n.p = g
n.z = d
c.z = n
c.o = d
c.q = a
c.s = a
d.o = i
i.z = e
i.q = e
i.o = c
i.w = a
i.u = a
i.y = d
e.p = n
g.t = n
g.p = n
g.z = d
l.z = g
l.o = d
l.q = a
l.s = a
assert d.o.u.w.o.o.z.t.p.txt == "n"