class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: D = None
        self.p: C = None
        self.r: C = None
        self.w: E = None
        self.v: G = None
        self.q: B = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: I = None
        self.y: A = None
        self.w: J = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: I = None
        self.y: A = None
        self.w: J = None
        self.z: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

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