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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.s: E = None
        self.v: E = None
        self.txt = txt

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

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

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

e = A("e")
d = B("d")
i = C("i")
m = D("m")
k = E("k")
h = E("h")

e.t = m
e.r = d
e.z = d
e.w = d
e.v = d
d.t = e
d.w = i
d.s = h
d.v = k
i.o = d
i.w = m
m.t = d
k.q = d
k.s = e
k.p = i
h.q = d
h.s = e
h.p = i
assert h.s.v.v.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.z: B = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: C = None
        self.s: E = None
        self.v: E = None
        self.txt = txt

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

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

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

e = A("e")
d = B("d")
i = C("i")
m = D("m")
k = E("k")
h = E("h")

e.t = m
e.r = d
e.z = d
e.w = d
e.v = d
d.t = e
d.w = i
d.s = h
d.v = k
i.o = d
i.w = m
m.t = d
k.q = d
k.s = e
k.p = i
h.q = d
h.s = e
h.p = i
assert h.s.v.v.p.o.txt == "d"