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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: F = None
        self.u: A = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.t: F = None
        self.s: B = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.v: D = None
        self.s: G = None
        self.r: D = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: F = None
        self.u: A = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.t: F = None
        self.s: B = None
        self.r: C = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.v: D = None
        self.s: G = None
        self.r: D = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

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