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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.y: C = None
        self.v: G = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.txt = txt

e = A("e")
k = B("k")
n = C("n")
g = D("g")
i = E("i")
j = F("j")
l = G("l")
d = H("d")

e.w = i
k.s = j
k.t = i
n.v = k
n.x = j
n.w = l
n.z = d
g.o = l
g.v = l
g.u = n
g.y = n
g.s = n
g.q = d
i.v = g
i.z = k
i.x = j
i.s = j
j.w = l
j.y = e
j.o = n
l.x = e
d.s = l
d.t = l
assert i.v.v.x.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.y: C = None
        self.v: G = None
        self.s: C = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.txt = txt

e = A("e")
k = B("k")
n = C("n")
g = D("g")
i = E("i")
j = F("j")
l = G("l")
d = H("d")

e.w = i
k.s = j
k.t = i
n.v = k
n.x = j
n.w = l
n.z = d
g.o = l
g.v = l
g.u = n
g.y = n
g.s = n
g.q = d
i.v = g
i.z = k
i.x = j
i.s = j
j.w = l
j.y = e
j.o = n
l.x = e
d.s = l
d.t = l
assert i.v.v.x.w.v.txt == "g"