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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.v: D = None
        self.y: F = None
        self.z: F = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.y: G = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

a = A("a")
i = B("i")
m = C("m")
n = D("n")
h = E("h")
e = F("e")
c = G("c")
d = C("d")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: B = None
        self.v: D = None
        self.y: F = None
        self.z: F = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: C = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.y: G = None
        self.z: C = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

a = A("a")
i = B("i")
m = C("m")
n = D("n")
h = E("h")
e = F("e")
c = G("c")
d = C("d")
g = B("g")

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