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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: F = None
        self.v: H = None
        self.s: E = None
        self.x: H = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.txt = txt

a = A("a")
f = B("f")
h = C("h")
k = D("k")
c = E("c")
m = F("m")
n = G("n")
b = H("b")
e = B("e")

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: F = None
        self.v: H = None
        self.s: E = None
        self.x: H = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: E = None
        self.t: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.txt = txt

a = A("a")
f = B("f")
h = C("h")
k = D("k")
c = E("c")
m = F("m")
n = G("n")
b = H("b")
e = B("e")

a.x = k
f.o = c
f.t = h
f.u = n
h.w = n
h.z = m
h.y = m
h.v = b
h.x = b
h.s = c
h.t = a
k.t = h
k.y = h
k.w = n
k.q = n
c.t = a
c.y = f
c.r = h
c.q = n
m.z = h
m.t = k
n.v = a
n.z = c
n.t = b
n.y = b
b.q = c
b.s = k
e.o = c
e.t = h
e.u = n
assert m.t.t.s.txt == "c"