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

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

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

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

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

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

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

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

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

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

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