class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: D = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.w: D = None
        self.p: A = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: E = None
        self.s: E = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.s: B = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: D = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

m.s = h
m.v = g
m.z = d
m.x = n
i.t = h
i.r = d
i.w = g
i.p = m
i.z = m
i.q = e
d.p = i
d.r = e
d.s = e
d.y = h
d.w = j
g.w = i
g.s = i
g.v = d
g.q = d
g.t = h
e.x = h
e.y = n
j.y = g
j.x = e
j.z = e
h.u = d
h.v = d
h.s = g
h.q = g
n.t = h
n.r = d
n.w = g
n.p = m
n.z = m
n.q = e
assert g.t.u.s.y.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: D = None
        self.z: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.w: D = None
        self.p: A = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: E = None
        self.s: E = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.s: B = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: D = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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