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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: D = None
        self.z: D = None
        self.v: A = None
        self.p: C = None
        self.x: B = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: D = None
        self.z: D = None
        self.v: A = None
        self.p: C = None
        self.x: B = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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