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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.v: D = None
        self.u: H = None
        self.t: H = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.y: D = None
        self.z: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.v: D = None
        self.u: H = None
        self.t: H = None
        self.y: D = None
        self.q: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.y: D = None
        self.z: D = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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