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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: J = None
        self.u: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: I = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: E = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: J = None
        self.u: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: I = None
        self.w: F = None
        self.txt = txt

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

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