class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.s: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: H = None
        self.t: A = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.x: B = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

a = A("a")
f = B("f")
h = C("h")
l = D("l")
j = E("j")
i = F("i")
k = G("k")
n = H("n")
m = D("m")

a.v = f
a.s = f
a.p = l
a.o = k
f.z = h
f.u = n
h.w = n
h.o = f
h.v = f
h.y = a
h.s = a
h.t = a
h.z = a
l.o = i
l.x = m
l.s = m
l.w = f
j.r = a
i.o = a
k.p = n
k.u = n
k.t = a
k.z = m
k.o = j
n.v = m
n.s = j
n.x = f
n.y = f
n.w = a
m.o = i
m.x = l
m.s = l
m.w = f
assert f.z.w.x.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.s: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: H = None
        self.t: A = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.x: B = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

a = A("a")
f = B("f")
h = C("h")
l = D("l")
j = E("j")
i = F("i")
k = G("k")
n = H("n")
m = D("m")

a.v = f
a.s = f
a.p = l
a.o = k
f.z = h
f.u = n
h.w = n
h.o = f
h.v = f
h.y = a
h.s = a
h.t = a
h.z = a
l.o = i
l.x = m
l.s = m
l.w = f
j.r = a
i.o = a
k.p = n
k.u = n
k.t = a
k.z = m
k.o = j
n.v = m
n.s = j
n.x = f
n.y = f
n.w = a
m.o = i
m.x = l
m.s = l
m.w = f
assert f.z.w.x.u.x.z.txt == "h"