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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: I = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: I = None
        self.p: I = None
        self.u: I = None
        self.r: B = None
        self.z: H = None
        self.v: B = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: I = None
        self.q: E = None
        self.o: D = None
        self.r: H = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.txt = txt

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

n.z = e
n.r = e
n.q = a
n.p = h
n.x = i
e.u = l
e.o = f
e.r = i
l.u = c
l.s = e
l.o = h
l.x = a
l.q = f
l.z = i
i.w = m
i.z = m
i.o = h
m.q = l
m.s = f
m.p = f
m.u = f
m.w = f
m.r = e
m.v = e
m.z = h
a.p = h
a.x = c
c.y = m
c.q = m
c.u = f
c.o = i
c.r = h
c.z = l
h.s = l
h.u = l
h.w = a
h.r = f
f.u = m
f.v = c
assert m.z.u.z.o.w.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: F = None
        self.p: H = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: I = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: E = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: I = None
        self.p: I = None
        self.u: I = None
        self.r: B = None
        self.z: H = None
        self.v: B = None
        self.w: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: I = None
        self.q: E = None
        self.o: D = None
        self.r: H = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: C = None
        self.w: F = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.txt = txt

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

n.z = e
n.r = e
n.q = a
n.p = h
n.x = i
e.u = l
e.o = f
e.r = i
l.u = c
l.s = e
l.o = h
l.x = a
l.q = f
l.z = i
i.w = m
i.z = m
i.o = h
m.q = l
m.s = f
m.p = f
m.u = f
m.w = f
m.r = e
m.v = e
m.z = h
a.p = h
a.x = c
c.y = m
c.q = m
c.u = f
c.o = i
c.r = h
c.z = l
h.s = l
h.u = l
h.w = a
h.r = f
f.u = m
f.v = c
assert m.z.u.z.o.w.x.z.txt == "l"