class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: H = None
        self.z: H = None
        self.r: F = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.y: D = None
        self.u: B = None
        self.t: A = None
        self.q: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: A = None
        self.p: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.y: D = None
        self.z: H = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.u: D = None
        self.q: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.o: A = None
        self.s: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

j = A("j")
b = B("b")
m = C("m")
c = D("c")
g = E("g")
n = F("n")
h = G("h")
a = H("a")

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: B = None
        self.y: D = None
        self.u: B = None
        self.t: A = None
        self.q: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: A = None
        self.p: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.y: D = None
        self.z: H = None
        self.w: E = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: D = None
        self.u: D = None
        self.q: A = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: E = None
        self.o: A = None
        self.s: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

j = A("j")
b = B("b")
m = C("m")
c = D("c")
g = E("g")
n = F("n")
h = G("h")
a = H("a")

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