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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

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

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

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

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

n = A("n")
h = B("h")
d = C("d")
f = D("f")
b = E("b")
l = F("l")
a = G("a")
e = H("e")
m = D("m")

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: C = None
        self.v: H = None
        self.o: H = None
        self.txt = txt

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

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

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

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

n = A("n")
h = B("h")
d = C("d")
f = D("f")
b = E("b")
l = F("l")
a = G("a")
e = H("e")
m = D("m")

n.w = d
n.q = e
n.u = e
n.x = m
n.t = h
n.s = h
n.z = l
n.p = l
h.t = b
d.x = a
d.p = n
d.t = f
f.t = l
f.x = d
f.v = e
f.o = e
b.s = a
b.x = l
b.o = n
b.y = m
b.v = h
b.z = f
l.z = a
l.x = a
l.o = a
l.q = h
l.s = b
a.x = d
a.p = d
a.o = d
e.q = n
e.p = a
e.r = l
e.y = f
m.t = l
m.x = d
m.v = e
m.o = e
assert n.p.x.x.x.txt == "a"