class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.t: B = None
        self.x: G = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.s: G = None
        self.t: G = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.u: D = None
        self.o: E = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.s: G = None
        self.t: G = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: B = None
        self.v: D = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.u: D = None
        self.o: E = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

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

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