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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.y: C = None
        self.u: C = None
        self.w: H = None
        self.x: H = None
        self.o: G = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.y: C = None
        self.u: C = None
        self.w: H = None
        self.x: H = None
        self.o: G = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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