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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.o: B = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: A = None
        self.o: B = None
        self.w: G = None
        self.txt = txt

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

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