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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

e = A("e")
f = B("f")
b = C("b")
l = D("l")
h = E("h")
m = A("m")

e.y = l
e.o = f
e.r = b
e.p = h
e.t = h
f.o = h
b.r = f
b.u = e
b.v = e
l.y = f
l.t = f
l.z = b
l.o = b
l.r = h
h.x = m
m.y = l
m.o = f
m.r = b
m.p = h
m.t = h
assert h.x.t.x.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.r: C = None
        self.p: E = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

e = A("e")
f = B("f")
b = C("b")
l = D("l")
h = E("h")
m = A("m")

e.y = l
e.o = f
e.r = b
e.p = h
e.t = h
f.o = h
b.r = f
b.u = e
b.v = e
l.y = f
l.t = f
l.z = b
l.o = b
l.r = h
h.x = m
m.y = l
m.o = f
m.r = b
m.p = h
m.t = h
assert h.x.t.x.r.v.txt == "e"