class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: G = None
        self.x: F = None
        self.t: C = None
        self.v: D = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: H = None
        self.z: F = None
        self.o: F = None
        self.p: E = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: E = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.q: H = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.q: A = None
        self.z: A = None
        self.p: E = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: H = None
        self.z: F = None
        self.o: F = None
        self.p: E = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: E = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: B = None
        self.q: H = None
        self.s: G = None
        self.p: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: F = None
        self.q: A = None
        self.z: A = None
        self.p: E = None
        self.r: E = None
        self.txt = txt

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

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