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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: G = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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