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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.o: I = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.p: G = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: C = None
        self.x: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.w: B = None
        self.v: I = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: A = None
        self.o: I = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.p: G = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: C = None
        self.x: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: A = None
        self.w: B = None
        self.v: I = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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