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

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

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

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

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

n = A("n")
j = B("j")
b = C("b")
a = D("a")
d = E("d")
i = B("i")
g = E("g")
e = D("e")

n.v = b
n.y = b
j.v = i
j.q = n
j.t = a
j.u = a
j.y = g
b.t = j
b.p = g
b.z = a
a.z = b
a.t = d
d.o = e
d.t = e
d.s = b
d.z = n
i.v = j
i.q = n
i.t = e
i.u = a
i.y = g
g.o = a
g.t = e
g.s = b
g.z = n
e.z = b
e.t = g
assert n.y.t.v.u.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

n = A("n")
j = B("j")
b = C("b")
a = D("a")
d = E("d")
i = B("i")
g = E("g")
e = D("e")

n.v = b
n.y = b
j.v = i
j.q = n
j.t = a
j.u = a
j.y = g
b.t = j
b.p = g
b.z = a
a.z = b
a.t = d
d.o = e
d.t = e
d.s = b
d.z = n
i.v = j
i.q = n
i.t = e
i.u = a
i.y = g
g.o = a
g.t = e
g.s = b
g.z = n
e.z = b
e.t = g
assert n.y.t.v.u.t.s.txt == "b"