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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.s: G = None
        self.x: G = None
        self.u: G = None
        self.y: G = None
        self.t: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.r: F = None
        self.x: A = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.s: G = None
        self.x: G = None
        self.u: G = None
        self.y: G = None
        self.t: E = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.r: F = None
        self.x: A = None
        self.t: C = None
        self.z: B = None
        self.txt = txt

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

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

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