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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.y: B = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.u: A = None
        self.o: A = None
        self.v: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: F = None
        self.y: B = None
        self.o: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: C = None
        self.x: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: A = None
        self.u: A = None
        self.o: A = None
        self.v: C = None
        self.x: A = None
        self.txt = txt

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

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

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