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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: G = None
        self.x: H = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.u: H = None
        self.x: A = None
        self.v: A = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.s: C = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: G = None
        self.x: H = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.u: H = None
        self.x: A = None
        self.v: A = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.s: C = None
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

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