class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: H = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.q: C = None
        self.s: H = None
        self.u: F = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.z: H = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.x: E = None
        self.p: C = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

m = A("m")
n = B("n")
g = C("g")
e = D("e")
c = E("c")
k = F("k")
l = G("l")
h = H("h")
d = H("d")

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: H = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: F = None
        self.q: C = None
        self.s: H = None
        self.u: F = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.z: H = None
        self.p: E = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.x: E = None
        self.p: C = None
        self.z: H = None
        self.r: C = None
        self.txt = txt

m = A("m")
n = B("n")
g = C("g")
e = D("e")
c = E("c")
k = F("k")
l = G("l")
h = H("h")
d = H("d")

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