class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.o: C = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: G = None
        self.p: E = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: G = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

e.t = g
e.s = m
e.o = h
e.r = i
g.p = e
g.w = e
g.y = h
g.v = i
h.v = n
h.q = n
h.p = m
h.s = k
k.v = e
k.u = i
k.y = i
k.w = i
k.t = g
k.o = g
m.p = g
m.r = c
c.q = k
c.r = k
c.o = n
n.z = i
i.w = g
i.u = g
i.p = m
i.y = k
i.v = k
assert n.z.y.t.txt == "g"