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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: G = None
        self.x: A = None
        self.y: E = None
        self.z: G = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: G = None
        self.x: A = None
        self.y: E = None
        self.z: G = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

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

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

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

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