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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: C = None
        self.w: E = None
        self.u: E = None
        self.t: F = None
        self.y: C = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: C = None
        self.w: E = None
        self.u: E = None
        self.t: F = None
        self.y: C = None
        self.p: D = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.txt = txt

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

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

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