class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: F = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: H = None
        self.s: H = None
        self.r: A = None
        self.y: F = None
        self.v: D = None
        self.q: D = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.v: C = None
        self.w: F = None
        self.x: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: H = None
        self.s: H = None
        self.r: A = None
        self.y: F = None
        self.v: D = None
        self.q: D = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.v: C = None
        self.w: F = None
        self.x: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: C = None
        self.v: E = None
        self.txt = txt

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

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