class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.v: G = None
        self.r: G = None
        self.p: F = None
        self.q: C = None
        self.s: C = None
        self.o: J = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.v: A = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: D = None
        self.w: I = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: J = None
        self.v: C = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: I = None
        self.x: J = None
        self.p: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: G = None
        self.v: A = None
        self.w: G = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: D = None
        self.w: I = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: J = None
        self.v: C = None
        self.t: J = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: J = None
        self.s: D = None
        self.t: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: I = None
        self.x: J = None
        self.p: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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