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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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