class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: H = None
        self.s: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: A = None
        self.w: D = None
        self.s: I = None
        self.t: D = None
        self.y: I = None
        self.z: G = None
        self.o: G = None
        self.x: I = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: I = None
        self.o: A = None
        self.t: D = None
        self.x: J = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: H = None
        self.x: C = None
        self.t: H = None
        self.y: E = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: E = None
        self.z: G = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.o: H = None
        self.p: G = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

h = A("h")
a = B("a")
d = C("d")
l = D("l")
k = E("k")
c = F("c")
m = G("m")
g = H("g")
b = I("b")
i = J("i")

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

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

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.p: A = None
        self.w: D = None
        self.s: I = None
        self.t: D = None
        self.y: I = None
        self.z: G = None
        self.o: G = None
        self.x: I = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: I = None
        self.o: A = None
        self.t: D = None
        self.x: J = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: H = None
        self.x: C = None
        self.t: H = None
        self.y: E = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: E = None
        self.z: G = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.o: H = None
        self.p: G = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

h = A("h")
a = B("a")
d = C("d")
l = D("l")
k = E("k")
c = F("c")
m = G("m")
g = H("g")
b = I("b")
i = J("i")

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