class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.s: I = None
        self.r: I = None
        self.u: I = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: J = None
        self.q: E = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.t: H = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.y: F = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.p: A = None
        self.v: H = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: J = None
        self.q: E = None
        self.t: A = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.t: H = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.x: E = None
        self.y: F = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.p: A = None
        self.v: H = None
        self.x: B = None
        self.txt = txt

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

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