class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: G = None
        self.t: C = None
        self.v: E = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.w: E = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: G = None
        self.u: E = None
        self.v: A = None
        self.s: F = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.w: F = None
        self.r: E = None
        self.v: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.w: E = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: G = None
        self.u: E = None
        self.v: A = None
        self.s: F = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: B = None
        self.w: F = None
        self.r: E = None
        self.v: H = None
        self.txt = txt

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

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

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