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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.s: H = None
        self.y: H = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: F = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.y: A = None
        self.u: G = None
        self.r: B = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: E = None
        self.s: H = None
        self.y: H = None
        self.t: H = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: F = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: E = None
        self.y: A = None
        self.u: G = None
        self.r: B = None
        self.z: A = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: A = None
        self.txt = txt

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

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