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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.w: D = None
        self.t: E = None
        self.txt = txt

d = A("d")
m = B("m")
f = C("f")
c = D("c")
l = E("l")
a = F("a")
j = G("j")
e = H("e")
b = H("b")

d.t = c
d.v = m
d.u = m
d.z = a
d.s = l
d.x = f
d.q = e
m.t = j
m.z = j
m.w = a
f.t = m
c.t = f
l.u = c
l.w = d
a.y = l
a.z = m
j.w = d
j.s = m
e.z = j
e.s = d
e.w = c
e.t = l
b.z = j
b.s = d
b.w = c
b.t = l
assert f.t.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: B = None
        self.z: F = None
        self.s: E = None
        self.x: C = None
        self.q: H = None
        self.u: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.w: D = None
        self.t: E = None
        self.txt = txt

d = A("d")
m = B("m")
f = C("f")
c = D("c")
l = E("l")
a = F("a")
j = G("j")
e = H("e")
b = H("b")

d.t = c
d.v = m
d.u = m
d.z = a
d.s = l
d.x = f
d.q = e
m.t = j
m.z = j
m.w = a
f.t = m
c.t = f
l.u = c
l.w = d
a.y = l
a.z = m
j.w = d
j.s = m
e.z = j
e.s = d
e.w = c
e.t = l
b.z = j
b.s = d
b.w = c
b.t = l
assert f.t.z.s.txt == "m"