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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.w: H = None
        self.r: B = None
        self.z: G = None
        self.o: G = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: E = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: D = None
        self.p: E = None
        self.s: F = None
        self.y: H = None
        self.v: F = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

f = A("f")
h = B("h")
m = C("m")
a = D("a")
j = E("j")
g = F("g")
c = G("c")
n = H("n")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.w: H = None
        self.r: B = None
        self.z: G = None
        self.o: G = None
        self.v: G = None
        self.y: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: E = None
        self.q: D = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: D = None
        self.p: E = None
        self.s: F = None
        self.y: H = None
        self.v: F = None
        self.q: G = None
        self.t: D = None
        self.txt = txt

f = A("f")
h = B("h")
m = C("m")
a = D("a")
j = E("j")
g = F("g")
c = G("c")
n = H("n")
e = H("e")

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