class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: H = None
        self.z: F = None
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: H = None
        self.z: F = None
        self.q: A = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: B = None
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

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

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