class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.z: I = None
        self.s: G = None
        self.x: B = None
        self.q: D = None
        self.t: I = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: A = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.p: G = None
        self.t: I = None
        self.y: I = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.v: G = None
        self.y: G = None
        self.z: F = None
        self.x: D = None
        self.r: I = None
        self.p: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: A = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.p: G = None
        self.t: I = None
        self.y: I = None
        self.v: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: G = None
        self.v: G = None
        self.y: G = None
        self.z: F = None
        self.x: D = None
        self.r: I = None
        self.p: F = None
        self.txt = txt

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

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

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