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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.t: F = None
        self.q: A = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.t: A = None
        self.r: A = None
        self.y: G = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: H = None
        self.u: E = None
        self.s: B = None
        self.r: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.o: B = None
        self.u: A = None
        self.q: G = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: H = None
        self.t: F = None
        self.q: A = None
        self.z: D = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: F = None
        self.t: A = None
        self.r: A = None
        self.y: G = None
        self.p: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: H = None
        self.u: E = None
        self.s: B = None
        self.r: G = None
        self.w: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.o: B = None
        self.u: A = None
        self.q: G = None
        self.v: G = None
        self.w: G = None
        self.txt = txt

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

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