class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: D = None
        self.u: H = None
        self.o: G = None
        self.v: C = None
        self.s: C = None
        self.r: G = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.u: G = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: I = None
        self.u: G = None
        self.t: B = None
        self.txt = txt

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

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

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