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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.t: A = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

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

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

b.p = l
a.z = g
g.p = m
g.q = l
g.r = l
g.t = b
g.u = d
h.o = l
h.x = b
h.t = b
d.p = m
d.z = m
d.x = c
d.t = c
n.r = k
n.s = g
n.x = g
n.v = a
n.q = a
n.z = b
n.o = h
m.r = d
m.s = d
m.u = g
m.o = a
c.p = m
c.u = g
k.r = n
k.s = g
k.x = g
k.v = a
k.q = a
k.z = b
k.o = l
l.o = h
l.x = b
l.t = b
assert m.u.r.t.p.x.p.o.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: D = None
        self.t: A = None
        self.u: E = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.o: B = None
        self.s: E = None
        self.txt = txt

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

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

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