class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: I = None
        self.t: E = None
        self.o: F = None
        self.z: E = None
        self.p: I = None
        self.u: I = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.x: G = None
        self.w: H = None
        self.q: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: I = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: I = None
        self.t: E = None
        self.o: F = None
        self.z: E = None
        self.p: I = None
        self.u: I = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.x: G = None
        self.w: H = None
        self.q: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: I = None
        self.t: E = None
        self.q: A = None
        self.txt = txt

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

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