class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.v: D = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.v: D = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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