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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.q: G = None
        self.w: B = None
        self.p: E = None
        self.o: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.o: E = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.q: E = None
        self.z: F = None
        self.u: B = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.q: G = None
        self.w: B = None
        self.p: E = None
        self.o: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.o: E = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: B = None
        self.q: E = None
        self.z: F = None
        self.u: B = None
        self.s: C = None
        self.w: G = None
        self.txt = txt

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

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