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

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: B = None
        self.q: E = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.p: C = None
        self.s: A = None
        self.r: C = None
        self.w: A = None
        self.y: A = None
        self.v: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: B = None
        self.q: E = None
        self.z: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: D = None
        self.p: C = None
        self.s: A = None
        self.r: C = None
        self.w: A = None
        self.y: A = None
        self.v: H = None
        self.txt = txt

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

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