class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.q: G = None
        self.s: C = None
        self.o: C = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.o: A = None
        self.z: A = None
        self.x: D = None
        self.w: G = None
        self.y: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: D = None
        self.o: A = None
        self.z: A = None
        self.x: D = None
        self.w: G = None
        self.y: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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