class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.v: E = None
        self.q: G = None
        self.w: G = None
        self.z: D = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: F = None
        self.r: H = None
        self.z: C = None
        self.v: G = None
        self.x: I = None
        self.p: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.v: E = None
        self.q: G = None
        self.w: G = None
        self.z: D = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: F = None
        self.r: H = None
        self.z: C = None
        self.v: G = None
        self.x: I = None
        self.p: I = None
        self.txt = txt

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

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