class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: D = None
        self.t: G = None
        self.p: F = None
        self.q: D = None
        self.o: E = None
        self.z: D = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: H = None
        self.x: J = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.o: B = None
        self.s: G = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: I = None
        self.s: E = None
        self.p: C = None
        self.x: B = None
        self.v: E = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: H = None
        self.t: J = None
        self.r: H = None
        self.w: J = None
        self.q: I = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: J = None
        self.q: H = None
        self.x: J = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: C = None
        self.o: B = None
        self.s: G = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: I = None
        self.s: E = None
        self.p: C = None
        self.x: B = None
        self.v: E = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: H = None
        self.t: J = None
        self.r: H = None
        self.w: J = None
        self.q: I = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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