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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.w: F = None
        self.q: H = None
        self.z: F = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: H = None
        self.w: F = None
        self.q: H = None
        self.z: F = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

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

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