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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: I = None
        self.t: F = None
        self.z: F = None
        self.r: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.y: D = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: E = None
        self.v: H = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: B = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: I = None
        self.t: F = None
        self.z: F = None
        self.r: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.y: D = None
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: E = None
        self.v: H = None
        self.q: B = None
        self.o: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: B = None
        self.r: D = None
        self.w: F = None
        self.txt = txt

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

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