class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: H = None
        self.v: F = None
        self.t: E = None
        self.w: I = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.x: J = None
        self.z: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.v: I = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.r: E = None
        self.w: B = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.v: F = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.t: B = None
        self.txt = txt

a = A("a")
c = B("c")
f = C("f")
b = D("b")
h = E("h")
n = F("n")
j = G("j")
g = H("g")
i = I("i")
l = J("l")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: H = None
        self.v: F = None
        self.t: E = None
        self.w: I = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: J = None
        self.x: J = None
        self.z: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.v: I = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: G = None
        self.r: E = None
        self.w: B = None
        self.q: E = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.v: F = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: H = None
        self.t: B = None
        self.txt = txt

a = A("a")
c = B("c")
f = C("f")
b = D("b")
h = E("h")
n = F("n")
j = G("j")
g = H("g")
i = I("i")
l = J("l")

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