class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: G = None
        self.q: D = None
        self.s: C = None
        self.u: F = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: A = None
        self.o: A = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: D = None
        self.p: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: A = None
        self.o: A = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

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

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