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

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

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

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

e = A("e")
b = B("b")
d = C("d")
m = D("m")
h = B("h")
n = B("n")
a = B("a")
i = D("i")

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

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

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

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

e = A("e")
b = B("b")
d = C("d")
m = D("m")
h = B("h")
n = B("n")
a = B("a")
i = D("i")

e.s = d
b.z = d
b.y = d
b.o = e
b.t = i
d.u = i
d.t = h
m.t = e
m.v = i
m.r = h
h.z = d
h.y = d
h.o = e
h.t = m
n.z = d
n.y = d
n.o = e
n.t = m
a.z = d
a.y = d
a.o = e
a.t = m
i.t = e
i.v = m
i.r = a
assert i.v.v.v.r.y.t.txt == "h"