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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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