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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.x: F = None
        self.p: I = None
        self.s: F = None
        self.q: G = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.u: A = None
        self.s: G = None
        self.p: B = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: H = None
        self.s: B = None
        self.r: B = None
        self.w: H = None
        self.z: C = None
        self.t: B = None
        self.q: I = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.w: C = None
        self.p: H = None
        self.v: I = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.x: F = None
        self.p: I = None
        self.s: F = None
        self.q: G = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.u: A = None
        self.s: G = None
        self.p: B = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: H = None
        self.s: B = None
        self.r: B = None
        self.w: H = None
        self.z: C = None
        self.t: B = None
        self.q: I = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.w: C = None
        self.p: H = None
        self.v: I = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: I = None
        self.txt = txt

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

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

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