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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.r: E = None
        self.w: E = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.u: J = None
        self.r: I = None
        self.p: C = None
        self.o: J = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.u: D = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: H = None
        self.q: E = None
        self.u: J = None
        self.r: D = None
        self.w: C = None
        self.s: A = None
        self.x: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: E = None
        self.w: A = None
        self.t: F = None
        self.u: B = None
        self.x: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: H = None
        self.u: C = None
        self.y: A = None
        self.w: G = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.r: E = None
        self.w: E = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: F = None
        self.u: J = None
        self.r: I = None
        self.p: C = None
        self.o: J = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.u: D = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: D = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: H = None
        self.q: E = None
        self.u: J = None
        self.r: D = None
        self.w: C = None
        self.s: A = None
        self.x: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: E = None
        self.w: A = None
        self.t: F = None
        self.u: B = None
        self.x: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: H = None
        self.u: C = None
        self.y: A = None
        self.w: G = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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