class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: D = None
        self.r: H = None
        self.p: G = None
        self.q: D = None
        self.x: J = None
        self.v: H = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: J = None
        self.w: G = None
        self.v: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.p: G = None
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: J = None
        self.w: G = None
        self.v: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.p: G = None
        self.r: H = None
        self.txt = txt

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

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