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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.z: J = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: F = None
        self.y: H = None
        self.r: B = None
        self.z: G = None
        self.s: J = None
        self.x: G = None
        self.o: H = None
        self.p: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: J = None
        self.y: C = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: I = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.q: H = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: D = None
        self.z: D = None
        self.q: I = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.z: J = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: F = None
        self.y: H = None
        self.r: B = None
        self.z: G = None
        self.s: J = None
        self.x: G = None
        self.o: H = None
        self.p: H = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: J = None
        self.y: C = None
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: I = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.v: F = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.q: H = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: D = None
        self.z: D = None
        self.q: I = None
        self.w: G = None
        self.txt = txt

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

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