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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.u: D = None
        self.q: D = None
        self.p: F = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.v: G = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.z: D = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = 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.w: D = None
        self.u: A = None
        self.o: C = None
        self.s: D = None
        self.t: B = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.u: D = None
        self.q: D = None
        self.p: F = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.v: G = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.z: D = None
        self.q: D = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: C = 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.w: D = None
        self.u: A = None
        self.o: C = None
        self.s: D = None
        self.t: B = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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