class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: E = None
        self.o: H = None
        self.q: F = None
        self.x: C = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.q: E = None
        self.w: A = None
        self.v: F = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.z: H = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: H = None
        self.w: B = None
        self.q: E = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: F = None
        self.t: F = None
        self.p: F = None
        self.s: E = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.q: E = None
        self.w: A = None
        self.v: F = None
        self.y: C = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.z: H = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: H = None
        self.w: B = None
        self.q: E = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: F = None
        self.t: F = None
        self.p: F = None
        self.s: E = None
        self.o: D = None
        self.x: B = None
        self.txt = txt

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

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