class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: D = None
        self.r: F = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.w: G = None
        self.u: H = None
        self.x: F = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.w: G = None
        self.u: H = None
        self.x: F = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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