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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.s: C = None
        self.q: F = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: D = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

g = A("g")
m = B("m")
k = C("k")
h = D("h")
a = E("a")
n = F("n")
f = G("f")
c = H("c")
b = F("b")

g.w = h
m.o = f
m.z = a
m.q = h
k.x = b
h.w = f
h.u = n
h.v = a
h.q = a
h.y = a
h.o = m
h.x = g
h.s = k
a.u = f
a.o = k
a.s = k
a.y = k
a.q = n
a.t = m
n.r = g
n.v = g
n.w = a
n.z = f
f.w = k
f.u = k
f.z = k
f.s = g
c.y = g
c.q = h
c.t = n
c.x = k
b.r = g
b.v = g
b.w = a
b.z = f
assert b.w.o.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.s: C = None
        self.q: F = None
        self.t: B = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: D = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

g = A("g")
m = B("m")
k = C("k")
h = D("h")
a = E("a")
n = F("n")
f = G("f")
c = H("c")
b = F("b")

g.w = h
m.o = f
m.z = a
m.q = h
k.x = b
h.w = f
h.u = n
h.v = a
h.q = a
h.y = a
h.o = m
h.x = g
h.s = k
a.u = f
a.o = k
a.s = k
a.y = k
a.q = n
a.t = m
n.r = g
n.v = g
n.w = a
n.z = f
f.w = k
f.u = k
f.z = k
f.s = g
c.y = g
c.q = h
c.t = n
c.x = k
b.r = g
b.v = g
b.w = a
b.z = f
assert b.w.o.x.v.txt == "g"