class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: D = None
        self.q: F = None
        self.s: D = None
        self.o: F = None
        self.p: G = None
        self.z: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: I = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.v: F = None
        self.r: I = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

e = A("e")
l = B("l")
b = C("b")
g = D("g")
m = E("m")
h = F("h")
f = G("f")
k = H("k")
i = I("i")
c = F("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: I = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.v: F = None
        self.r: I = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.x: D = None
        self.z: E = None
        self.o: D = None
        self.txt = txt

e = A("e")
l = B("l")
b = C("b")
g = D("g")
m = E("m")
h = F("h")
f = G("f")
k = H("k")
i = I("i")
c = F("c")

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