class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: G = None
        self.u: D = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.v: D = None
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.p: E = None
        self.o: D = None
        self.y: D = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.v: D = None
        self.w: H = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: G = None
        self.p: E = None
        self.o: D = None
        self.y: D = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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