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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.s: F = None
        self.z: H = None
        self.x: H = None
        self.u: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.r: F = None
        self.s: B = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

g = A("g")
k = B("k")
b = C("b")
n = D("n")
f = E("f")
e = F("e")
i = G("i")
m = H("m")
d = I("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.s: F = None
        self.z: H = None
        self.x: H = None
        self.u: D = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.z: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.r: F = None
        self.s: B = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

g = A("g")
k = B("k")
b = C("b")
n = D("n")
f = E("f")
e = F("e")
i = G("i")
m = H("m")
d = I("d")

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