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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.z: A = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.q: E = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

a = A("a")
l = B("l")
e = C("e")
n = D("n")
b = E("b")
f = C("f")
c = C("c")
g = A("g")

a.u = b
a.s = n
l.s = n
l.v = n
e.u = a
e.p = f
e.z = g
e.q = g
e.t = l
n.z = f
n.v = e
n.o = e
n.q = b
n.x = b
b.y = l
f.u = g
f.q = g
f.p = c
f.z = a
f.t = l
c.u = a
c.q = a
c.p = f
c.z = g
c.t = l
g.u = b
g.s = n
assert n.z.t.v.z.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.z: A = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.q: E = None
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

a = A("a")
l = B("l")
e = C("e")
n = D("n")
b = E("b")
f = C("f")
c = C("c")
g = A("g")

a.u = b
a.s = n
l.s = n
l.v = n
e.u = a
e.p = f
e.z = g
e.q = g
e.t = l
n.z = f
n.v = e
n.o = e
n.q = b
n.x = b
b.y = l
f.u = g
f.q = g
f.p = c
f.z = a
f.t = l
c.u = a
c.q = a
c.p = f
c.z = g
c.t = l
g.u = b
g.s = n
assert n.z.t.v.z.p.t.txt == "l"