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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: G = None
        self.x: A = None
        self.z: H = None
        self.y: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.r: B = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.z: D = None
        self.v: H = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.z: F = None
        self.v: D = None
        self.q: H = None
        self.u: G = None
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: G = None
        self.x: A = None
        self.z: H = None
        self.y: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: A = None
        self.r: B = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: C = None
        self.z: D = None
        self.v: H = None
        self.o: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: D = None
        self.z: F = None
        self.v: D = None
        self.q: H = None
        self.u: G = None
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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