class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: D = None
        self.z: G = None
        self.o: I = None
        self.y: G = None
        self.w: D = None
        self.r: F = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: I = None
        self.v: F = None
        self.z: I = None
        self.x: E = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: I = None
        self.v: F = None
        self.z: I = None
        self.x: E = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.txt = txt

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

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