class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.r: B = None
        self.q: E = None
        self.y: A = None
        self.s: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: H = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.r: B = None
        self.q: E = None
        self.y: A = None
        self.s: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: H = None
        self.t: F = None
        self.txt = txt

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

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