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

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

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

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

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

k = A("k")
e = B("e")
d = C("d")
b = D("b")
m = E("m")
g = C("g")
a = D("a")
h = B("h")
j = C("j")

k.v = h
k.o = h
e.x = b
d.z = e
d.o = k
b.v = k
b.x = m
b.u = m
b.z = d
m.w = g
m.x = a
m.s = h
g.z = e
g.o = k
a.v = k
a.x = m
a.u = m
a.z = j
h.x = a
j.z = h
j.o = k
assert b.u.s.x.v.v.x.v.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.txt = txt

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

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

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

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

k = A("k")
e = B("e")
d = C("d")
b = D("b")
m = E("m")
g = C("g")
a = D("a")
h = B("h")
j = C("j")

k.v = h
k.o = h
e.x = b
d.z = e
d.o = k
b.v = k
b.x = m
b.u = m
b.z = d
m.w = g
m.x = a
m.s = h
g.z = e
g.o = k
a.v = k
a.x = m
a.u = m
a.z = j
h.x = a
j.z = h
j.o = k
assert b.u.s.x.v.v.x.v.o.x.txt == "a"