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

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

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

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

e = A("e")
c = B("c")
h = C("h")
j = D("j")
a = D("a")
m = C("m")
k = D("k")
b = B("b")

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

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

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

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

e = A("e")
c = B("c")
h = C("h")
j = D("j")
a = D("a")
m = C("m")
k = D("k")
b = B("b")

e.v = c
c.t = e
c.o = m
h.r = c
h.t = m
h.x = m
h.o = j
j.w = e
j.z = e
a.w = e
a.z = e
m.r = c
m.t = h
m.x = h
m.o = a
k.w = e
k.z = e
b.t = e
b.o = m
assert c.t.v.o.r.o.o.txt == "a"