class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.q: J = None
        self.p: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.p: C = None
        self.u: C = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: A = None
        self.t: A = None
        self.v: E = None
        self.p: C = None
        self.s: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: F = None
        self.y: B = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

b = A("b")
n = B("n")
i = C("i")
j = D("j")
g = E("g")
a = F("a")
c = G("c")
f = H("f")
l = I("l")
d = J("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.q: J = None
        self.p: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: A = None
        self.p: C = None
        self.u: C = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: A = None
        self.t: A = None
        self.v: E = None
        self.p: C = None
        self.s: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: F = None
        self.y: B = None
        self.z: E = None
        self.t: B = None
        self.txt = txt

b = A("b")
n = B("n")
i = C("i")
j = D("j")
g = E("g")
a = F("a")
c = G("c")
f = H("f")
l = I("l")
d = J("d")

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